primitive

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverPostgres   = "postgres"
	DriverPostgresql = "postgresql"
	DriverMySQL      = "mysql"
	DriverDuckDB     = "duckdb"
	DriverSQLite3    = "sqlite3"
	DriverSQLite     = "sqlite"
)

Variables

This section is empty.

Functions

func FlowpipeMetadataOutput added in v0.3.0

func FlowpipeMetadataOutput(startedAt, finshedAt time.Time) map[string]interface{}

Types

type Container

type Container struct {
	FullyQualifiedStepName string
}

func (*Container) Run

func (cp *Container) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Container) ValidateInput

func (cp *Container) ValidateInput(ctx context.Context, i modconfig.Input) error

type Email

type Email struct {
	Input modconfig.Input
}

func (*Email) Run

func (h *Email) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Email) ValidateInput

func (h *Email) ValidateInput(ctx context.Context, i modconfig.Input) error

type Exec

type Exec struct{}

func (*Exec) Run

func (e *Exec) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Exec) ValidateInput

func (e *Exec) ValidateInput(ctx context.Context, i modconfig.Input) error

type FileBasedQueryReader added in v0.2.1

type FileBasedQueryReader struct {
	QueryReaderImpl
}

func (*FileBasedQueryReader) Initialize added in v0.2.1

func (s *FileBasedQueryReader) Initialize() error

type Function

type Function struct{}

func (*Function) Run

func (e *Function) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Function) ValidateInput

func (e *Function) ValidateInput(ctx context.Context, i modconfig.Input) error

type HTTPInput

type HTTPInput struct {
	URL            string
	Method         string
	RequestBody    string
	RequestHeaders map[string]interface{}
	CaCertPem      string
	Insecure       bool
	Timeout        time.Duration
}

type HTTPRequest

type HTTPRequest struct {
	Input modconfig.Input
}

func (*HTTPRequest) Run

func (*HTTPRequest) ValidateInput

func (h *HTTPRequest) ValidateInput(ctx context.Context, i modconfig.Input) error

type Input

type Input struct {
	ExecutionID         string
	PipelineExecutionID string
	StepExecutionID     string
	PipelineName        string
	StepName            string
}

func NewInputPrimitive added in v0.3.0

func NewInputPrimitive(executionId, pipelineExecutionId, stepExecutionId, pipelineName, stepName string) *Input

func (*Input) Run

func (ip *Input) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Input) ValidateInput

func (ip *Input) ValidateInput(ctx context.Context, i modconfig.Input) error

type InputIntegration

type InputIntegration interface {
	PostMessage(ctx context.Context, inputType string, prompt string, options []InputIntegrationResponseOption) (*modconfig.Output, error)
}

type InputIntegrationBase

type InputIntegrationBase struct {
	ExecutionID         string
	PipelineExecutionID string
	StepExecutionID     string
}

func NewInputIntegrationBase added in v0.3.0

func NewInputIntegrationBase(input *Input) InputIntegrationBase

type InputIntegrationEmail

type InputIntegrationEmail struct {
	InputIntegrationBase

	Host       *string
	Port       *int64
	SecurePort *int64
	Tls        *string
	To         []string
	Cc         []string
	Bcc        []string
	From       string
	Subject    string
	User       *string
	Pass       *string
	FormUrl    string
}

func NewInputIntegrationEmail added in v0.3.0

func NewInputIntegrationEmail(base InputIntegrationBase) InputIntegrationEmail

func (*InputIntegrationEmail) PostMessage

func (*InputIntegrationEmail) ValidateInputIntegrationEmail

func (ip *InputIntegrationEmail) ValidateInputIntegrationEmail(ctx context.Context, i modconfig.Input) error

type InputIntegrationEmailMessage added in v0.3.0

type InputIntegrationEmailMessage interface {
	Message() (string, error)
}

type InputIntegrationMsTeams added in v0.4.0

type InputIntegrationMsTeams struct {
	InputIntegrationBase
	IntegrationName string
	WebhookUrl      *string
}

func NewInputIntegrationMsTeams added in v0.4.0

func NewInputIntegrationMsTeams(base InputIntegrationBase, name string) InputIntegrationMsTeams

func (*InputIntegrationMsTeams) PostMessage added in v0.4.0

type InputIntegrationResponseOption added in v0.3.0

type InputIntegrationResponseOption struct {
	Label    *string
	Value    *string
	Selected *bool
	Style    *string
}

type InputIntegrationSlack

type InputIntegrationSlack struct {
	InputIntegrationBase
	Token         *string
	SigningSecret *string
	WebhookUrl    *string
	Channel       *string
}

func NewInputIntegrationSlack added in v0.3.0

func NewInputIntegrationSlack(base InputIntegrationBase) InputIntegrationSlack

func (*InputIntegrationSlack) PostMessage

type InputStepMessageCreator added in v0.3.0

type InputStepMessageCreator struct {
	Prompt    string
	InputType string
	StepName  string
}

func (*InputStepMessageCreator) EmailMessage added in v0.3.0

func (*InputStepMessageCreator) MsTeamsMessage added in v0.4.0

func (*InputStepMessageCreator) SlackMessage added in v0.3.0

type JSONPayload

type JSONPayload struct {
	PipelineExecutionID string `json:"pipeline_execution_id"`
	StepExecutionID     string `json:"step_execution_id"`
	ExecutionID         string `json:"execution_id"`
}

type Message added in v0.3.0

type Message struct {
	Input
}

func NewMessagePrimitive added in v0.3.0

func NewMessagePrimitive(executionId, pipelineExecutionId, stepExecutionId, pipelineName, stepName string) *Message

func (*Message) Run added in v0.3.0

func (mp *Message) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Message) ValidateInput added in v0.3.0

func (mp *Message) ValidateInput(ctx context.Context, input modconfig.Input) error

type MessageStepMessageCreator added in v0.3.0

type MessageStepMessageCreator struct {
	Text string
}

func (*MessageStepMessageCreator) EmailMessage added in v0.3.0

func (*MessageStepMessageCreator) MsTeamsMessage added in v0.4.0

func (*MessageStepMessageCreator) SlackMessage added in v0.3.0

type MySQLQueryReader added in v0.2.1

type MySQLQueryReader struct {
	QueryReaderImpl
}

func (*MySQLQueryReader) Query added in v0.2.1

func (m *MySQLQueryReader) Query(ctx context.Context, queryString string, args ...interface{}) ([]map[string]interface{}, map[string]*sql.ColumnType, error)

func (*MySQLQueryReader) RowsToCty added in v0.2.1

func (m *MySQLQueryReader) RowsToCty(rows []map[string]interface{}, columnTypes map[string]*sql.ColumnType) ([]cty.Value, error)

type MySQLRowReader added in v0.2.1

type MySQLRowReader struct {
	RowReaderImpl
}

func (*MySQLRowReader) Read added in v0.2.1

func (m *MySQLRowReader) Read(rows *sql.Rows, columnTypeMap map[string]*sql.ColumnType) ([]map[string]interface{}, error)

func (*MySQLRowReader) RowToCty added in v0.2.1

func (m *MySQLRowReader) RowToCty(row map[string]interface{}, columnTypes map[string]*sql.ColumnType) (cty.Value, error)

type PostgresQueryReader added in v0.2.1

type PostgresQueryReader struct {
	QueryReaderImpl
}

func (*PostgresQueryReader) Initialize added in v0.2.1

func (p *PostgresQueryReader) Initialize() error

type Primitive

type Primitive interface {
	Run(modconfig.Input) (*modconfig.Output, error)
}

type Query

type Query struct {
	QueryReader QueryReader
}

func (*Query) Run

func (e *Query) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Query) RunWithMetadata added in v0.2.1

func (e *Query) RunWithMetadata(ctx context.Context, input modconfig.Input) (*modconfig.Output, map[string]*sql.ColumnType, error)

func (*Query) ValidateInput

func (e *Query) ValidateInput(ctx context.Context, i modconfig.Input) error

type QueryReader added in v0.2.1

type QueryReader interface {
	GetConnectionString() string
	Initialize() error
	Query(context.Context, string, ...interface{}) ([]map[string]interface{}, map[string]*sql.ColumnType, error)
	RowsToCty(rows []map[string]interface{}, columnTypes map[string]*sql.ColumnType) ([]cty.Value, error)
	Close()
}

func NewQueryReader added in v0.2.1

func NewQueryReader(dbConnectionString string) (QueryReader, error)

type QueryReaderImpl added in v0.2.1

type QueryReaderImpl struct {
	// contains filtered or unexported fields
}

func (*QueryReaderImpl) Close added in v0.2.1

func (q *QueryReaderImpl) Close()

func (*QueryReaderImpl) GetConnectionString added in v0.2.1

func (q *QueryReaderImpl) GetConnectionString() string

func (*QueryReaderImpl) Initialize added in v0.2.1

func (q *QueryReaderImpl) Initialize() error

func (*QueryReaderImpl) Query added in v0.2.1

func (q *QueryReaderImpl) Query(ctx context.Context, queryString string, args ...interface{}) ([]map[string]interface{}, map[string]*sql.ColumnType, error)

func (*QueryReaderImpl) RowsToCty added in v0.2.1

func (q *QueryReaderImpl) RowsToCty(rows []map[string]interface{}, columnTypes map[string]*sql.ColumnType) ([]cty.Value, error)

type RowReader added in v0.2.1

type RowReader interface {
	Read(*sql.Rows, map[string]*sql.ColumnType) ([]map[string]interface{}, error)
	RowToCty(row map[string]interface{}, columnTypes map[string]*sql.ColumnType) (cty.Value, error)
}

type RowReaderImpl added in v0.2.1

type RowReaderImpl struct {
}

func (*RowReaderImpl) Read added in v0.2.1

func (r *RowReaderImpl) Read(rows *sql.Rows, columnTypeMap map[string]*sql.ColumnType) ([]map[string]interface{}, error)

func (*RowReaderImpl) RowToCty added in v0.2.1

func (r *RowReaderImpl) RowToCty(row map[string]interface{}, columnTypes map[string]*sql.ColumnType) (cty.Value, error)

Attempt to have a generic function to convert a row to cty. It may not work for all the database that Flowpipe will support, the types are structured so it can be extended to various different DB Row Readers

type RunPipeline

type RunPipeline struct{}

func (*RunPipeline) Run

func (*RunPipeline) ValidateInput

func (e *RunPipeline) ValidateInput(ctx context.Context, input modconfig.Input) error

type SQLiteQueryReader added in v0.2.1

type SQLiteQueryReader struct {
	QueryReaderImpl
}

func (*SQLiteQueryReader) Initialize added in v0.2.1

func (s *SQLiteQueryReader) Initialize() error

type Sleep

type Sleep struct{}

func (*Sleep) Run

func (e *Sleep) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Sleep) ValidateInput

func (e *Sleep) ValidateInput(ctx context.Context, input modconfig.Input) error

type Transform

type Transform struct{}

func (*Transform) Run

func (e *Transform) Run(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*Transform) ValidateInput

func (e *Transform) ValidateInput(ctx context.Context, i modconfig.Input) error

Jump to

Keyboard shortcuts

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