pipeline

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(config BuilderConfig, yamlTaskCreator TaskCreator, commentTaskCreator TaskCreator, fs afero.Fs) *builder

Types

type Asset added in v0.9.0

type Asset struct {
	Name            string
	Description     string
	Type            AssetType
	ExecutableFile  ExecutableFile
	DefinitionFile  TaskDefinitionFile
	Parameters      map[string]string
	Connection      string
	DependsOn       []string
	Schedule        TaskSchedule
	Materialization Materialization
	Columns         map[string]Column

	Pipeline *Pipeline
	// contains filtered or unexported fields
}

func ConvertYamlToTask

func ConvertYamlToTask(content []byte) (*Asset, error)

func (*Asset) AddDownstream added in v0.11.0

func (a *Asset) AddDownstream(asset *Asset)

func (*Asset) AddUpstream added in v0.11.0

func (a *Asset) AddUpstream(asset *Asset)

func (*Asset) GetDownstream added in v0.11.0

func (a *Asset) GetDownstream() []*Asset

func (*Asset) GetFullDownstream added in v0.11.0

func (a *Asset) GetFullDownstream() []*Asset

func (*Asset) GetFullUpstream added in v0.11.0

func (a *Asset) GetFullUpstream() []*Asset

func (*Asset) GetUpstream added in v0.11.0

func (a *Asset) GetUpstream() []*Asset

type AssetType added in v0.9.0

type AssetType string

type BuilderConfig

type BuilderConfig struct {
	PipelineFileName    string
	TasksDirectoryName  string
	TasksDirectoryNames []string
	TasksFileSuffixes   []string
}

type Column added in v0.9.0

type Column struct {
	Name        string
	Description string        `yaml:"description"`
	Checks      []ColumnCheck `yaml:"checks"`
}

type ColumnCheck added in v0.9.0

type ColumnCheck struct {
	Name  string `yaml:"name"`
	Value ColumnCheckValue
}

type ColumnCheckValue added in v0.9.0

type ColumnCheckValue struct {
	IntArray    *[]int
	Int         *int
	Float       *float64
	StringArray *[]string
	String      *string
}

type DefinitionFile

type DefinitionFile struct {
	Name string
	Path string
}

type ExecutableFile

type ExecutableFile struct {
	Name    string
	Path    string
	Content string
}

type Materialization

type Materialization struct {
	Type           MaterializationType
	Strategy       MaterializationStrategy
	PartitionBy    string
	ClusterBy      []string
	IncrementalKey string
}

type MaterializationStrategy

type MaterializationStrategy string
const (
	MaterializationStrategyNone          MaterializationStrategy = ""
	MaterializationStrategyCreateReplace MaterializationStrategy = "create+replace"
	MaterializationStrategyDeleteInsert  MaterializationStrategy = "delete+insert"
	MaterializationStrategyAppend        MaterializationStrategy = "append"
)

type MaterializationType

type MaterializationType string
const (
	MaterializationTypeNone  MaterializationType = ""
	MaterializationTypeView  MaterializationType = "view"
	MaterializationTypeTable MaterializationType = "table"
)

type Notifications

type Notifications struct {
	Slack []SlackNotification
}

type Pipeline

type Pipeline struct {
	LegacyID           string   `yaml:"id"`
	Name               string   `yaml:"name"`
	Schedule           schedule `yaml:"schedule"`
	StartDate          string   `yaml:"start_date"`
	DefinitionFile     DefinitionFile
	DefaultParameters  map[string]string `yaml:"default_parameters"`
	DefaultConnections map[string]string `yaml:"default_connections"`
	Tasks              []*Asset
	Notifications      Notifications `yaml:"notifications"`

	TasksByType map[AssetType][]*Asset
	// contains filtered or unexported fields
}

func (*Pipeline) GetAssetByPath added in v0.11.0

func (p *Pipeline) GetAssetByPath(assetPath string) *Asset

func (*Pipeline) GetConnectionNameForAsset added in v0.10.0

func (p *Pipeline) GetConnectionNameForAsset(asset *Asset) string

func (Pipeline) HasAssetType added in v0.11.0

func (p Pipeline) HasAssetType(taskType AssetType) bool

func (*Pipeline) RelativeAssetPath added in v0.11.0

func (p *Pipeline) RelativeAssetPath(t *Asset) string

type SlackNotification

type SlackNotification struct {
	Name       string
	Connection string
	Success    string
	Failure    string
}

type TaskCreator

type TaskCreator func(path string) (*Asset, error)

func CreateTaskFromFileComments

func CreateTaskFromFileComments(fs afero.Fs) TaskCreator

func CreateTaskFromYamlDefinition

func CreateTaskFromYamlDefinition(fs afero.Fs) TaskCreator

type TaskDefinitionFile

type TaskDefinitionFile struct {
	Name string
	Path string
	Type TaskDefinitionType
}

type TaskDefinitionType

type TaskDefinitionType string
const (
	CommentTask TaskDefinitionType = "comment"
	YamlTask    TaskDefinitionType = "yaml"
)

type TaskSchedule

type TaskSchedule struct {
	Days []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL