flow

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 82 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 (
	// Direktiv Headers.
	ServiceHeaderName          = "direktiv.io/name"
	ServiceHeaderNamespaceID   = "direktiv.io/namespace-id"
	ServiceHeaderNamespaceName = "direktiv.io/namespace-name"
	ServiceHeaderWorkflowID    = "direktiv.io/workflow-id"
	ServiceHeaderPath          = "direktiv.io/workflow-name"
	ServiceHeaderRevision      = "direktiv.io/revision"
	ServiceHeaderSize          = "direktiv.io/size"
	ServiceHeaderScale         = "direktiv.io/scale"
	ServiceTemplateGeneration  = "direktiv.io/templateGeneration"
	ServiceHeaderScope         = "direktiv.io/scope"

	// Serving Headers.
	ServiceKnativeHeaderName            = "serving.knative.dev/service"
	ServiceKnativeHeaderConfiguration   = "serving.knative.dev/configuration"
	ServiceKnativeHeaderGeneration      = "serving.knative.dev/configurationGeneration"
	ServiceKnativeHeaderRevision        = "serving.knative.dev/revision"
	ServiceKnativeHeaderRolloutDuration = "serving.knative.dev/rolloutDuration"
)

NOTE: old constants.

View Source
const (
	DirektivActionIDHeader    = "Direktiv-ActionID"
	DirektivInstanceIDHeader  = "Direktiv-InstanceID"
	DirektivExchangeKeyHeader = "Direktiv-ExchangeKey"
	DirektivPingAddrHeader    = "Direktiv-PingAddr"
	DirektivDeadlineHeader    = "Direktiv-Deadline"
	DirektivTimeoutHeader     = "Direktiv-Timeout"
	DirektivStepHeader        = "Direktiv-Step"
	DirektivIteratorHeader    = "Direktiv-Iterator"
	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.

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"
	ErrCodeNotArray               = "direktiv.foreach.badArray"
	ErrCodeFailedSchemaValidation = "direktiv.schema.failed"
	ErrCodeJQNotString            = "direktiv.jq.notString"
	ErrCodeInvalidVariableKey     = "direktiv.var.invalidKey"
)
View Source
var (
	ErrNotDir         = errors.New("not a directory")
	ErrNotWorkflow    = errors.New("not a workflow")
	ErrNotMirror      = errors.New("not a git mirror")
	ErrMirrorLocked   = errors.New("git mirror is locked")
	ErrMirrorUnlocked = errors.New("git mirror is not locked")
)

Functions

func GetInodePath

func GetInodePath(path string) string

GetInodePath returns the exact path to a inode.

func NoCancelContext added in v0.8.2

func NoCancelContext(ctx context.Context) context.Context

WithoutCancel returns a context that is never canceled.

func PublishKnativeEvent

func PublishKnativeEvent(ce *cloudevents.Event)

func Run

func Run(serverCtx context.Context) error

func SanitizeLabel added in v0.8.1

func SanitizeLabel(s string) string

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 EventingCtxKey

type EventingCtxKey string
const EventingCtxKeySource EventingCtxKey = "source"

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.

Directories

Path Synopsis
Package states implements the logic for Direktiv workflow states.
Package states implements the logic for Direktiv workflow states.

Jump to

Keyboard shortcuts

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