Skip to content

Commit

Permalink
refactor: continued refactoring to support dynamic pipelines.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Neudegg <andrew.neudegg@finbourne.com>
  • Loading branch information
AndrewNeudegg committed Jan 6, 2021
1 parent 504a486 commit 93efd6e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
26 changes: 26 additions & 0 deletions pkg/configs/container.go
@@ -0,0 +1,26 @@
package configs

import (
"github.com/andrewneudegg/delta/pkg/pipelines/definitions"
)

// AppSettings is application level configuration.
type AppSettings struct{}

// Container wraps all subconfiguration
type Container struct {
// ApplicationSettings apply to the whole app.
ApplicationSettings AppSettings `yaml:"app"`
// SourceConfigs defines the behaviours of sinks/bridges.
Pipeline []definitions.PipelineNode `yaml:"pipeline"`
}

// FromBytes will load a container from bytes.
func FromBytes(b []byte) (Container, error) {
return Container{}, nil
}

// FromFile will load a container from file.
func FromFile(s string) (Container, error) {
return Container{}, nil
}
5 changes: 3 additions & 2 deletions pkg/pipelines/definitions/node.go
Expand Up @@ -2,6 +2,7 @@ package definitions

// PipelineNode represents a block in a pipeline.
type PipelineNode struct {
ID string `mapstructure:"id"` // ID is the name of this thing.
Config map[string]interface{} `mapstructure:"config"` // Config of this node.
ID string `yaml:"id"`
Config map[string]interface{} `yaml:"config"`
Nodes []PipelineNode `yaml:"nodes"`
}
6 changes: 3 additions & 3 deletions pkg/pipelines/fipfo/fipfo.go
Expand Up @@ -10,9 +10,9 @@ import (
// Pipeline is a type of pipeline that fans in inputs,
// applies processing, then fans out to the various outputs.
type Pipeline struct {
Inputs definitions.PipelineNode `mapstructure:"id"`
Processes definitions.PipelineNode `mapstructure:"id"`
Outputs definitions.PipelineNode `mapstructure:"id"`
Inputs definitions.PipelineNode `mapstructure:"input"`
Processes definitions.PipelineNode `mapstructure:"process"`
Outputs definitions.PipelineNode `mapstructure:"output"`
}

func (f Pipeline) ID() string {
Expand Down

0 comments on commit 93efd6e

Please sign in to comment.