flow

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 75 Imported by: 0

Documentation

Index

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"
	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 IsNotFound added in v0.5.0

func IsNotFound(err error) bool

func NewInternalError added in v0.5.0

func NewInternalError(err error) error

func Run added in v0.5.0

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

func SyncSubscribeTo added in v0.5.0

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

SyncSubscribeTo subscribes to direktiv interna postgres pub/sub

func WrapCatchableError added in v0.5.0

func WrapCatchableError(msg string, err error) error

Types

type Carrier added in v0.5.0

type Carrier struct {
	Trace map[string]string
}

func (*Carrier) Get added in v0.5.0

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

func (*Carrier) Keys added in v0.5.0

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

func (*Carrier) Set added in v0.5.0

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

type CatchableError added in v0.5.0

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

func NewCatchableError added in v0.5.0

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

func (*CatchableError) Error added in v0.5.0

func (err *CatchableError) Error() string

type InternalError added in v0.5.0

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

func NewInternalErrorWithDepth added in v0.5.0

func NewInternalErrorWithDepth(err error, depth int) *InternalError

func (*InternalError) Error added in v0.5.0

func (err *InternalError) Error() string

func (*InternalError) Unwrap added in v0.5.0

func (err *InternalError) Unwrap() error

type NotFoundError added in v0.5.0

type NotFoundError struct {
	Label string
}

func (*NotFoundError) Error added in v0.5.0

func (err *NotFoundError) Error() string

type PubsubUpdate added in v0.5.0

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

type ServiceResponse added in v0.5.0

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 added in v0.5.0

type UncatchableError struct {
	Code    string
	Message string
}

func NewUncatchableError added in v0.5.0

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

func (*UncatchableError) Error added in v0.5.0

func (err *UncatchableError) Error() string

Jump to

Keyboard shortcuts

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