flow

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 80 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BroadcastEventTypeCreate is an event type for listening to 'create'
	BroadcastEventTypeCreate string = "create"
	// BroadcastEventTypeUpdate is an event type for listening to 'update'
	BroadcastEventTypeUpdate string = "update"
	// BroadcastEventTypeDelete is an event type for listenting to 'delete'
	BroadcastEventTypeDelete string = "delete"

	BroadcastEventTypeInstanceStarted string = "started"
	BroadcastEventTypeInstanceFailed  string = "failed"
	BroadcastEventTypeInstanceSuccess string = "success"
)
View Source
const (
	// BroadcastEventScopeWorkflow is the scope in which you want to listen for events
	BroadcastEventScopeWorkflow string = "workflow"
	// BroadcastEventScopeNamespace is the scope in which you want to listen for events
	BroadcastEventScopeNamespace string = "namespace"
	// BroadcastEventScopeInstance is the scope in which you want to listen for events
	BroadcastEventScopeInstance string = "instance"
)
View Source
const (
	// BroadcastEventPrefixWorkflow is the event prefix that is being broadcasted
	BroadcastEventPrefixWorkflow string = "workflow"
	// BroadcastEventPrefixDirectory is the event prefix that is being broadcasted
	BroadcastEventPrefixDirectory string = "directory"
	// BroadcastEventPrefixVariable is the event prefix that is being broadcasted
	BroadcastEventPrefixVariable string = "variable"
	// BroadcastEventPrefixInstance is the event prefix that is being broadcasted
	BroadcastEventPrefixInstance string = "instance"
)
View Source
const (
	DirektivActionIDHeader    = "Direktiv-ActionID"
	DirektivInstanceIDHeader  = "Direktiv-InstanceID"
	DirektivExchangeKeyHeader = "Direktiv-ExchangeKey"
	DirektivPingAddrHeader    = "Direktiv-PingAddr"
	DirektivDeadlineHeader    = "Direktiv-Deadline"
	DirektivTimeoutHeader     = "Direktiv-Timeout"
	DirektivStepHeader        = "Direktiv-Step"
	DirektivResponseHeader    = "Direktiv-Response"
	DirektivNamespaceHeader   = "Direktiv-Namespace"
	DirektivSourceHeader      = "Direktiv-Source"
	DirektivFileHeader        = "Direktiv-Files"

	DirektivErrorCodeHeader    = "Direktiv-ErrorCode"
	DirektivErrorMessageHeader = "Direktiv-ErrorMessage"
)

headers for flow->container communication

View Source
const (
	ServiceResponseNoError = ""
	ServiceErrorInternal   = "au.com.direktiv.error.internal"
	ServiceErrorImage      = "au.com.direktiv.error.image"
	ServiceErrorNetwork    = "au.com.direktiv.error.network"
	ServiceErrorIO         = "au.com.direktiv.error.io"
)

internal error codes for knative services

View Source
const (
	StatusPending  = "pending"
	StatusFailed   = "failed"
	StatusCrashed  = "crashed"
	StatusComplete = "complete"
)
View Source
const CancelActionMessage = "cancelAction"

Variables

View Source
var (
	ErrCodeInternal               = "direktiv.internal.error"
	ErrCodeWorkflowUnparsable     = "direktiv.workflow.unparsable"
	ErrCodeMultipleErrors         = "direktiv.workflow.multipleErrors"
	ErrCodeCancelledByParent      = "direktiv.cancels.parent"
	ErrCodeSoftTimeout            = "direktiv.cancels.timeout.soft"
	ErrCodeHardTimeout            = "direktiv.cancels.timeout.hard"
	ErrCodeJQBadQuery             = "direktiv.jq.badCommand"
	ErrCodeJQNotObject            = "direktiv.jq.notObject"
	ErrCodeAllBranchesFailed      = "direktiv.parallel.allFailed"
	ErrCodeFailedSchemaValidation = "direktiv.schema.failed"
)
View Source
var (
	ErrNotDir      = errors.New("not a directory")
	ErrNotWorkflow = errors.New("not a workflow")
)

Functions

func GetInodePath

func GetInodePath(path string) string

GetInodePath returns the exact path to a inode

func IsNotFound

func IsNotFound(err error) bool

func NewInternalError

func NewInternalError(err error) error

func PublishKnativeEvent

func PublishKnativeEvent(ce *cloudevents.Event)

func Run

func Run(ctx context.Context, logger *zap.SugaredLogger, conf *util.Config) error

func SyncSubscribeTo

func SyncSubscribeTo(log *zap.Logger, addr, topic string, fn func(interface{})) error

SyncSubscribeTo subscribes to direktiv interna postgres pub/sub

func WrapCatchableError

func WrapCatchableError(msg string, err error) error

Types

type Carrier

type Carrier struct {
	Trace map[string]string
}

Carrier controls the trace

func (*Carrier) Get

func (c *Carrier) Get(key string) string

Get returns a value of a trace

func (*Carrier) Keys

func (c *Carrier) Keys() []string

Keys returns all the keys of the trace

func (*Carrier) Set

func (c *Carrier) Set(key, val string)

Set sets a trace key and value

type CatchableError

type CatchableError struct {
	Code    string `json:"code"`
	Message string `json:"msg"`
}

func NewCatchableError

func NewCatchableError(code string, msg string, a ...interface{}) *CatchableError

func (*CatchableError) Error

func (err *CatchableError) Error() string

type Config

type Config struct {
	Broadcast *ConfigBroadcast `json:"broadcast"`
}

type ConfigBroadcast

type ConfigBroadcast struct {
	WorkflowCreate          *bool `json:"workflow.create"`
	WorkflowUpdate          *bool `json:"workflow.update"`
	WorkflowDelete          *bool `json:"workflow.delete"`
	DirectoryCreate         *bool `json:"directory.create"`
	DirectoryDelete         *bool `json:"directory.delete"`
	WorkflowVariableCreate  *bool `json:"workflow.variable.create"`
	WorkflowVariableUpdate  *bool `json:"workflow.variable.update"`
	WorkflowVariableDelete  *bool `json:"workflow.variable.delete"`
	NamespaceVariableCreate *bool `json:"namespace.variable.create"`
	NamespaceVariableUpdate *bool `json:"namespace.variable.update"`
	NamespaceVariableDelete *bool `json:"namespace.variable.delete"`
	InstanceVariableCreate  *bool `json:"instance.variable.create"`
	InstanceVariableUpdate  *bool `json:"instance.variable.update"`
	InstanceVariableDelete  *bool `json:"instance.variable.delete"`
	InstanceStarted         *bool `json:"instance.started"`
	InstanceSuccess         *bool `json:"instance.success"`
	InstanceFailed          *bool `json:"instance.failed"`
}

type EventingCtxKey

type EventingCtxKey string
const EventingCtxKeySource EventingCtxKey = "source"

type InternalError

type InternalError struct {
	Err      error
	Function string
	File     string
	Line     int
}

func NewInternalErrorWithDepth

func NewInternalErrorWithDepth(err error, depth int) *InternalError

func (*InternalError) Error

func (err *InternalError) Error() string

func (*InternalError) Unwrap

func (err *InternalError) Unwrap() error

type NotFoundError

type NotFoundError struct {
	Label string
}

func (*NotFoundError) Error

func (err *NotFoundError) Error() string

type PubsubUpdate

type PubsubUpdate struct {
	Handler  string
	Sender   string
	Key      string
	Hostname string
}

type ServiceResponse

type ServiceResponse struct {
	ErrorCode    string      `json:"errorCode"`
	ErrorMessage string      `json:"errorMessage"`
	Data         interface{} `json:"data"`
}

ServiceResponse is the response structure for internal knative services

type UncatchableError

type UncatchableError struct {
	Code    string
	Message string
}

func NewUncatchableError

func NewUncatchableError(code, msg string, a ...interface{}) *UncatchableError

func (*UncatchableError) Error

func (err *UncatchableError) Error() string

Jump to

Keyboard shortcuts

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