primitive

package
v0.3.0-beta.202401300929 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: AGPL-3.0 Imports: 51 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

This section is empty.

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
}

func (*Input) ProcessOutput

func (ip *Input) ProcessOutput(c *gin.Context, inputType InputType, requestBody []byte) (*modconfig.Output, error)

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(modconfig.Input) error
	ReceiveMessage() (*modconfig.Output, error)
}

type InputIntegrationBase

type InputIntegrationBase struct {
	ExecutionID         string
	PipelineExecutionID string
	StepExecutionID     string
}

type InputIntegrationEmail

type InputIntegrationEmail struct {
	InputIntegrationBase
}

func (*InputIntegrationEmail) PostMessage

func (i *InputIntegrationEmail) PostMessage(ctx context.Context, input modconfig.Input) (*modconfig.Output, error)

func (*InputIntegrationEmail) ReceiveMessage

func (*InputIntegrationEmail) ReceiveMessage(c *gin.Context) (*modconfig.Output, error)

func (*InputIntegrationEmail) ValidateInputIntegrationEmail

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

type InputIntegrationSlack

type InputIntegrationSlack struct {
	InputIntegrationBase
}

func (*InputIntegrationSlack) PostMessage

func (ip *InputIntegrationSlack) PostMessage(input modconfig.Input) error

func (*InputIntegrationSlack) ReceiveMessage

func (*InputIntegrationSlack) ReceiveMessage(ctx context.Context, requestBody []byte) (*modconfig.Output, error)

type InputType

type InputType string
const (
	InputTypeSlack InputType = "slack"
	InputTypeEmail InputType = "email"
)

type JSONPayload

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

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