Documentation ¶
Index ¶
- Constants
- Variables
- func AddGlobalGRPCDialOption(opt grpc.DialOption)
- func AddGlobalGRPCServerOption(opt grpc.ServerOption)
- func GetEndpointTLS(endpoint string, rr bool) (*grpc.ClientConn, error)
- func GrpcStart(server **grpc.Server, name, bind string, register func(srv *grpc.Server)) error
- func InstanceMemory(rec *ent.WorkflowInstance) ([]byte, error)
- func NewInternalError(err error) error
- func SyncSubscribeTo(dbConnString string, topic int, fn func(interface{})) error
- func WrapCatchableError(msg string, err error) error
- type CatchableError
- type CmdErrorResponse
- type Config
- type ErrorType
- type InternalError
- type KubeResolver
- type KubeResolverBuilder
- type ServiceResponse
- type SyncRequest
- type UncatchableError
- type WorkflowServer
Constants ¶
const ( // DirektivDebug enables debug on dirtektiv applications DirektivDebug = "DIREKTIV_DEBUG" // DBConn database connection DBConn = "DIREKTIV_DB" )
const ( // TLSCert cert TLSCert = "/etc/certs/direktiv/tls.crt" // TLSKey key TLSKey = "/etc/certs/direktiv/tls.key" // TLSCA cert CA TLSCA = "/etc/certs/direktiv/ca.crt" )
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
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
const ( CancelIsolate = iota CancelSubflow CancelTimer CancelInstanceTimers AddCron )
direktiv pub/sub items
const ApiSync = "apisync"
const FlowSync = "flowsync"
FlowSync is the name of postgres pubsub channel
const (
// WorkflowStateSubscription is the channel that runs workflow states.
WorkflowStateSubscription = "workflow-state"
)
Variables ¶
var ( ErrCodeJQBadQuery = "direktiv.jq.badCommand" ErrCodeJQNotObject = "direktiv.jq.notObject" ErrCodeMultipleErrors = "direktiv.workflow.multipleErrors" ErrCodeAllBranchesFailed = "direktiv.parallel.allFailed" )
internal errors
Functions ¶
func AddGlobalGRPCDialOption ¶ added in v0.2.3
func AddGlobalGRPCDialOption(opt grpc.DialOption)
func AddGlobalGRPCServerOption ¶ added in v0.2.3
func AddGlobalGRPCServerOption(opt grpc.ServerOption)
func GetEndpointTLS ¶ added in v0.2.1
func GetEndpointTLS(endpoint string, rr bool) (*grpc.ClientConn, error)
GetEndpointTLS creates a grpc client
func InstanceMemory ¶ added in v0.2.3
func InstanceMemory(rec *ent.WorkflowInstance) ([]byte, error)
func NewInternalError ¶
func SyncSubscribeTo ¶ added in v0.2.1
SyncSubscribeTo subscribes to direktiv interna postgres pub/sub
func WrapCatchableError ¶
Types ¶
type CatchableError ¶
func NewCatchableError ¶
func NewCatchableError(code string, msg string, a ...interface{}) *CatchableError
func (*CatchableError) Error ¶
func (err *CatchableError) Error() string
type CmdErrorResponse ¶
CmdErrorResponse struct for responding when command has an error
type Config ¶
type Config struct { FlowAPI struct { Bind string Endpoint string Exchange string Sidecar string Protocol string } `toml:"flowAPI"` IngressAPI struct { Bind string Endpoint string } `toml:"ingressAPI"` Database struct { DB string } InstanceLogging struct { Driver string } VariablesStorage struct { Driver string } }
Config is the configuration for workflow and runner server
func ReadConfig ¶
ReadConfig reads the configuration file and overwrites with environment variables if set
type ErrorType ¶
type ErrorType int
ErrorType types of errors direktiv commands can return
func GetErrorType ¶
GetErrorType get Error Type from passed error
type InternalError ¶
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 KubeResolver ¶ added in v0.2.1
type KubeResolver struct { }
KubeResolver ...
func NewResolver ¶ added in v0.2.1
func NewResolver() *KubeResolver
NewResolver returns a resolve for kubernetes
func (*KubeResolver) Close ¶ added in v0.2.1
func (r *KubeResolver) Close()
Close closes the resoolver
func (*KubeResolver) ResolveNow ¶ added in v0.2.1
func (r *KubeResolver) ResolveNow(o resolver.ResolveNowOptions)
ResolveNow does nothing in our case
type KubeResolverBuilder ¶ added in v0.2.1
type KubeResolverBuilder struct { }
KubeResolverBuilder ...
func (*KubeResolverBuilder) Build ¶ added in v0.2.1
func (b *KubeResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build ...
func (*KubeResolverBuilder) Scheme ¶ added in v0.2.1
func (b *KubeResolverBuilder) Scheme() string
Scheme returns the default scheme for this reoslver
type ServiceResponse ¶ added in v0.2.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 SyncRequest ¶ added in v0.2.0
SyncRequest sync maintenance requests between instances subscribed to FlowSync
type UncatchableError ¶
func NewUncatchableError ¶
func NewUncatchableError(code, msg string, a ...interface{}) *UncatchableError
func (*UncatchableError) Error ¶
func (err *UncatchableError) Error() string
type WorkflowServer ¶
type WorkflowServer struct { LifeLine chan bool // contains filtered or unexported fields }
WorkflowServer is a direktiv server
func NewWorkflowServer ¶
func NewWorkflowServer(config *Config) (*WorkflowServer, error)
NewWorkflowServer creates a new workflow server
func (*WorkflowServer) Lifeline ¶
func (s *WorkflowServer) Lifeline() chan bool
Lifeline interface impl
func (*WorkflowServer) Run ¶
func (s *WorkflowServer) Run() error
Run starts all components of direktiv
func (*WorkflowServer) SetInstanceLogger ¶
func (s *WorkflowServer) SetInstanceLogger(l dlog.Log)
SetInstanceLogger set logger for direktiv for firecracker instances
func (*WorkflowServer) SetVariableStorage ¶ added in v0.2.3
func (s *WorkflowServer) SetVariableStorage(vs varstore.VarStorage)
Source Files ¶
- config.go
- db-events.go
- db-instance.go
- db-namespace.go
- db-workflow.go
- db.go
- engine-util.go
- engine.go
- errors.go
- events.go
- flow.go
- grpc-instances.go
- grpc-namespace.go
- grpc-secreg.go
- grpc-variables.go
- grpc-workflow.go
- grpc.go
- grpc_util.go
- health.go
- isolate.go
- kubereq.go
- metrics.go
- resolver.go
- secrets.go
- state-logic-action.go
- state-logic-consume-event.go
- state-logic-delay.go
- state-logic-error.go
- state-logic-eventsand.go
- state-logic-eventsxor.go
- state-logic-foreach.go
- state-logic-generate-event.go
- state-logic-getter.go
- state-logic-parallel.go
- state-logic-setter.go
- state-logic-switch.go
- state-logic-validate.go
- state-logic.go
- sync.go
- timer.go
- wfserver.go
- wli.go