types

package
v0.1.0-beta.202310300232 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputModeIds = map[OutputMode][]string{
	OutputModeTable: {"table"},
	OutputModeYaml:  {"yaml"},
	OutputModeJson:  {"json"},
}

③ Map enumeration values to their textual representations (value identifiers).

Functions

This section is empty.

Types

type APIVersionRequestURI

type APIVersionRequestURI struct {
	APIVersion string `uri:"api_version" binding:"required,flowpipe_api_version"`
}

APIVersionRequestURI defines the requested API version.

type CmdPipeline

type CmdPipeline struct {
	Command       string                 `json:"command" binding:"required,oneof=run"`
	Args          map[string]interface{} `json:"args,omitempty"`
	ArgsString    map[string]string      `json:"args_string,omitempty"`
	ExecutionMode *string                `json:"execution_mode,omitempty" binding:"omitempty,oneof=synchronous asynchronous"`
}

type CmdProcess

type CmdProcess struct {
	Command             string `json:"command" binding:"required,oneof=run cancel pause resume"`
	PipelineExecutionID string `json:"pipeline_execution_id,omitempty" format:"^(pexec|exec)_[0-9a-v]{20}$"`
	Reason              string `json:"reason,omitempty"`
}

type EventLogEntry

type EventLogEntry struct {
	EventType string          `json:"event_type"`
	Timestamp *time.Time      `json:"ts"`
	Payload   json.RawMessage `json:"payload"`
}

type FpPipelineParam

type FpPipelineParam struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	Optional    *bool   `json:"optional,omitempty"`
	Default     *string `json:"default,omitempty"`
	Type        string  `json:"type"`
}

type FpTrigger

type FpTrigger struct {
	Name          string            `json:"name"`
	Type          string            `json:"type"`
	Description   *string           `json:"description,omitempty"`
	Pipeline      string            `json:"pipeline"`
	Url           *string           `json:"url,omitempty"`
	Title         *string           `json:"title"`
	Documentation *string           `json:"documentation"`
	Tags          map[string]string `json:"tags"`
}

type GetPipelineResponse

type GetPipelineResponse struct {
	Name          string                     `json:"name"`
	Description   *string                    `json:"description,omitempty"`
	Mod           string                     `json:"mod"`
	Title         *string                    `json:"title,omitempty"`
	Documentation *string                    `json:"documentation,omitempty"`
	Tags          map[string]string          `json:"tags"`
	Steps         []modconfig.IPipelineStep  `json:"steps,omitempty"`
	OutputConfig  []modconfig.PipelineOutput `json:"outputs,omitempty"`
	Params        []FpPipelineParam          `json:"params,omitempty"`
}

type InputRequestQuery

type InputRequestQuery struct {
	ExecutionMode       *string `json:"execution_mode" form:"execution_mode" binding:"omitempty,oneof=synchronous asynchronous"`
	ExecutionID         string  `json:"execution_id" form:"execution_id" binding:"omitempty"`
	PipelineExecutionID string  `json:"pipeline_execution_id" form:"pipeline_execution_id" binding:"omitempty"`
	StepExecutionID     string  `json:"step_execution_id" form:"step_execution_id" binding:"omitempty"`
	Value               string  `json:"value" form:"value"`
}

type InputRequestUri

type InputRequestUri struct {
	Input string `json:"input" uri:"input" binding:"required"`
	Hash  string `json:"hash" uri:"hash" binding:"required"`
}

type ListPipelineResponse

type ListPipelineResponse struct {
	Items     []ListPipelineResponseItem `json:"items"`
	NextToken *string                    `json:"next_token,omitempty"`
}

This type is used by the API to return a list of pipelines.

type ListPipelineResponseItem

type ListPipelineResponseItem struct {
	Name          string            `json:"name"`
	Description   *string           `json:"description,omitempty"`
	Mod           string            `json:"mod"`
	Title         *string           `json:"title,omitempty"`
	Documentation *string           `json:"documentation,omitempty"`
	Tags          map[string]string `json:"tags"`
}

type ListProcessLogJSONResponse

type ListProcessLogJSONResponse struct {
	Items     []ProcessEventLog `json:"items"`
	NextToken *string           `json:"next_token,omitempty"`
}

type ListProcessLogResponse

type ListProcessLogResponse struct {
	Items     []EventLogEntry `json:"items"`
	NextToken *string         `json:"next_token,omitempty"`
}

This type is used by the API to return a list of proces logs.

type ListProcessResponse

type ListProcessResponse struct {
	Items     []Process `json:"items"`
	NextToken *string   `json:"next_token,omitempty"`
}

This type is used by the API to return a list of processs.

type ListRequestQuery

type ListRequestQuery struct {
	NextToken string `json:"next_token" form:"next_token" binding:"omitempty"`
	Limit     *int   `json:"limit,omitempty" form:"limit" binding:"omitempty"`
}

type ListTriggerResponse

type ListTriggerResponse struct {
	Items     []FpTrigger `json:"items"`
	NextToken *string     `json:"next_token,omitempty"`
}

This type is used by the API to return a list of triggers.

type ListVariableResponse

type ListVariableResponse struct {
	Items     []Variable `json:"items"`
	NextToken *string    `json:"next_token,omitempty"`
}

This type is used by the API to return a list of variables.

type OutputMode

type OutputMode enumflag.Flag

① Define your new enum flag type. It can be derived from enumflag.Flag, but it doesn't need to be as long as it satisfies constraints.Integer.

const (
	OutputModeTable OutputMode = iota
	OutputModeYaml
	OutputModeJson
)

② Define the enumeration values for FooMode.

type PipelineExecutionResponse

type PipelineExecutionResponse map[string]interface{}

type PipelineRequestQuery

type PipelineRequestQuery struct {
	ExecutionMode *string `json:"execution_mode" form:"execution_mode" binding:"omitempty,oneof=synchronous asynchronous"`
}

type PipelineRequestURI

type PipelineRequestURI struct {
	PipelineName string `uri:"pipeline_name" binding:"required" format:"^[a-z_]{0,32}$"`
}

type PrintablePipeline

type PrintablePipeline struct {
	Items interface{}
}

func (PrintablePipeline) GetColumns

func (PrintablePipeline) GetColumns() (columns []TableColumnDefinition)

func (PrintablePipeline) GetItems

func (p PrintablePipeline) GetItems() interface{}

func (PrintablePipeline) GetTable

func (p PrintablePipeline) GetTable() (Table, error)

func (PrintablePipeline) Transform

func (PrintablePipeline) Transform(r flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)

type PrintableProcess

type PrintableProcess struct {
	Items interface{}
}

func (PrintableProcess) GetColumns

func (PrintableProcess) GetColumns() (columns []TableColumnDefinition)

func (PrintableProcess) GetItems

func (p PrintableProcess) GetItems() interface{}

func (PrintableProcess) GetTable

func (p PrintableProcess) GetTable() (Table, error)

func (PrintableProcess) Transform

func (PrintableProcess) Transform(r flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)

type PrintableResource

type PrintableResource interface {
	Transform(flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)
	GetItems() interface{}
	GetTable() (Table, error)
}

type PrintableTrigger

type PrintableTrigger struct {
	Items interface{}
}

func (PrintableTrigger) GetColumns

func (PrintableTrigger) GetColumns() (columns []TableColumnDefinition)

func (PrintableTrigger) GetItems

func (p PrintableTrigger) GetItems() interface{}

func (PrintableTrigger) GetTable

func (p PrintableTrigger) GetTable() (Table, error)

func (PrintableTrigger) Transform

func (PrintableTrigger) Transform(r flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)

type PrintableVariable

type PrintableVariable struct {
	Items interface{}
}

func (PrintableVariable) GetColumns

func (PrintableVariable) GetColumns() (columns []TableColumnDefinition)

func (PrintableVariable) GetItems

func (p PrintableVariable) GetItems() interface{}

func (PrintableVariable) GetTable

func (p PrintableVariable) GetTable() (Table, error)

func (PrintableVariable) Transform

func (PrintableVariable) Transform(r flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)

type Process

type Process struct {
	ID        string    `json:"execution_id"`
	Pipeline  string    `json:"pipeline"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

The definition of a single Flowpipe Process

type ProcessEventLog

type ProcessEventLog struct {
	EventType string     `json:"event_type"`
	Timestamp *time.Time `json:"ts"`
	// Setting the type as string for now, as the CLI need to print the payload
	Payload string `json:"payload"`
}

Identical to the EventLogEntry struct in internal/types/execution.go Using the EventLogEntry returned an error at the time of openapi generation: cannot find type definition: json.RawMessage TODO - Recheck to use the EventLogEntry struct

type ProcessOutputData

type ProcessOutputData struct {
	ID     string                 `json:"process_id"`
	Output map[string]interface{} `json:"output"`
}

type ProcessPayload

type ProcessPayload struct {
	PipelineName        string              `json:"name"`
	PipelineExecutionID string              `json:"pipeline_execution_id"`
	Event               ProcessPayloadEvent `json:"event"`
}

Process log payload definition

type ProcessPayloadEvent

type ProcessPayloadEvent struct {
	CreatedAt time.Time `json:"created_at"`
}

type ProcessRequestURI

type ProcessRequestURI struct {
	// TODO: do we want to pass the ExecutionID or PipelineExecutionID? The log is stored under ExecutionID but the execution works with PipelineExecutionID
	// ProcessId string `uri:"process_id" binding:"required" format:"^(pexec|exec)_[0-9a-v]{20}$"`
	ProcessId string `uri:"process_id" binding:"required" format:"^exec_[0-9a-v]{20}$"`
}

type Stack

type Stack struct {
	ID         string            `json:"id"`
	Status     string            `json:"status"`
	StepStatus map[int]string    `json:"pipeline_step_status"`
	Stacks     map[string]*Stack `json:"children"`
}

type Table

type Table struct {
	Rows    []TableRow
	Columns []TableColumnDefinition
}

func (Table) GetItems

func (p Table) GetItems() interface{}

func (Table) GetTable

func (p Table) GetTable() (Table, error)

func (Table) Transform

func (Table) Transform(r flowpipeapiclient.FlowpipeAPIResource) (interface{}, error)

type TableColumnDefinition

type TableColumnDefinition struct {
	// name is a human readable name for the column.
	Name string `json:"name"`
	// type is an OpenAPI type definition for this column, such as number, integer, string, or
	// array.
	// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
	Type string `json:"type"`
	// format is an optional OpenAPI type modifier for this column. A format modifies the type and
	// imposes additional rules, like date or time formatting for a string. The 'name' format is applied
	// to the primary identifier column which has type 'string' to assist in clients identifying column
	// is the resource name.
	// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
	Format string `json:"format"`
	// description is a human readable description of this column.
	Description string `json:"description"`
	// priority is an integer defining the relative importance of this column compared to others. Lower
	// numbers are considered higher priority. Columns that may be omitted in limited space scenarios
	// should be given a higher priority.
	Priority int32 `json:"priority"`
}

Taken from kubectl

func (*TableColumnDefinition) Formatter

func (t *TableColumnDefinition) Formatter() string

type TableRow

type TableRow struct {
	Cells []interface{}
}

type TriggerRequestURI

type TriggerRequestURI struct {
	TriggerName string `uri:"trigger_name" binding:"required" format:"^[a-z]{0,32}$"`
}

type Variable

type Variable struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

The definition of a single Flowpipe Variable

type VariableRequestURI

type VariableRequestURI struct {
	VariableName string `uri:"variable_name" binding:"required" format:"^[a-z]{0,32}$"`
}

type WebhookRequestQuery

type WebhookRequestQuery struct {
	ExecutionMode *string `json:"execution_mode" form:"execution_mode" binding:"omitempty,oneof=synchronous asynchronous"`
}

type WebhookRequestUri

type WebhookRequestUri struct {
	Trigger string `json:"trigger" uri:"trigger" binding:"required"`
	Hash    string `json:"hash" uri:"hash" binding:"required"`
}

Jump to

Keyboard shortcuts

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