engine

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidInstanceChildInfo = errors.New("invalid instance child info")
View Source
var ErrInvalidInstanceDescentInfo = errors.New("invalid instance descent info")
View Source
var ErrInvalidInstanceRuntimeInfo = errors.New("invalid instance runtime info")
View Source
var ErrInvalidInstanceSettings = errors.New("invalid instance settings")
View Source
var ErrInvalidInstanceTelemetryInfo = errors.New("invalid instance telemetry info")

Functions

func AddTag added in v0.8.4

func AddTag(ctx context.Context, key, value interface{}) context.Context

func BuildInstanceTrack added in v0.8.4

func BuildInstanceTrack(instance *Instance) string

func BuildNamespaceTrack added in v0.8.4

func BuildNamespaceTrack(namespace string) string

func GetSlogAttributesWithError added in v0.8.4

func GetSlogAttributesWithError(ctx context.Context, err error) []interface{}

func GetSlogAttributesWithStatus added in v0.8.4

func GetSlogAttributesWithStatus(ctx context.Context, status core.LogStatus) []interface{}

func WithTrack added in v0.8.4

func WithTrack(ctx context.Context, track string) context.Context

Types

type ChildInfo

type ChildInfo struct {
	ID          string `json:"id"`
	Async       bool   `json:"async"`
	Complete    bool   `json:"complete"`
	Type        string `json:"type"`
	Attempts    int    `json:"attempts"`
	ServiceName string `json:"service_name"`
}

ChildInfo is part of the ChildrenInfo structure. It represents useful information about a single child action.

type Instance

type Instance struct {
	Instance      *instancestore.InstanceData
	TelemetryInfo *InstanceTelemetryInfo
	RuntimeInfo   *InstanceRuntimeInfo
	Settings      *InstanceSettings
	DescentInfo   *InstanceDescentInfo
}

func ParseInstanceData

func ParseInstanceData(idata *instancestore.InstanceData) (*Instance, error)

func (*Instance) GetAttributes

func (instance *Instance) GetAttributes(recipientType recipient.RecipientType) map[string]string

func (*Instance) WithTags added in v0.8.4

func (instance *Instance) WithTags(ctx context.Context) context.Context

type InstanceChildInfoV1

type InstanceChildInfoV1 struct {
	Version  string      `json:"version"`
	Children []ChildInfo `json:"children"`
}

type InstanceChildrenInfo

type InstanceChildrenInfo struct {
	Version  string // to let us identify and correct outdated versions of this struct
	Children []ChildInfo
}

ChildrenInfo keeps some useful information about all direct child actions of this instance.

func LoadInstanceChildInfo

func LoadInstanceChildInfo(data []byte) (*InstanceChildrenInfo, error)

func (*InstanceChildrenInfo) MarshalJSON

func (info *InstanceChildrenInfo) MarshalJSON() ([]byte, error)

type InstanceDescentInfo

type InstanceDescentInfo struct {
	Version string       // to let us identify and correct outdated versions of this struct
	Descent []ParentInfo // chain of callers from the root instance to the direct parent.
}

InstanceDescentInfo keeps a local copy of useful information about the entire chain of parent instances all the way to the root instance, excepting this instance.

func LoadInstanceDescentInfo

func LoadInstanceDescentInfo(data []byte) (*InstanceDescentInfo, error)

func (*InstanceDescentInfo) MarshalJSON

func (info *InstanceDescentInfo) MarshalJSON() ([]byte, error)

type InstanceDescentInfoV1

type InstanceDescentInfoV1 struct {
	Version string       `json:"version"`
	Descent []ParentInfo `json:"descent"`
}

type InstanceRuntimeInfo

type InstanceRuntimeInfo struct {
	Version        string // to let us identify and correct outdated versions of this struct
	Controller     string
	Flow           []string // NOTE: now that we keep a copy of the definition we could replace []string with []int
	StateBeginTime time.Time
	Attempts       int
}

InstanceRuntimeInfo keeps other miscellaneous information useful to the engine.

func LoadInstanceRuntimeInfo

func LoadInstanceRuntimeInfo(data []byte) (*InstanceRuntimeInfo, error)

func (*InstanceRuntimeInfo) MarshalJSON

func (info *InstanceRuntimeInfo) MarshalJSON() ([]byte, error)

type InstanceSettings

type InstanceSettings struct {
	Version     string // to let us identify and correct outdated versions of this struct
	LogToEvents string
}

InstanceSettings keeps a local copy of various namespace and workflow settings so that the engine doesn't have to look them up separately.

func LoadInstanceSettings

func LoadInstanceSettings(data []byte) (*InstanceSettings, error)

func (*InstanceSettings) MarshalJSON

func (info *InstanceSettings) MarshalJSON() ([]byte, error)

type InstanceTelemetryInfo

type InstanceTelemetryInfo struct {
	Version  string // to let us identify and correct outdated versions of this struct
	TraceID  string
	SpanID   string
	CallPath string

	NamespaceName string
}

InstanceTelemetryInfo keeps information useful to our telemetry logic.

func LoadInstanceTelemetryInfo

func LoadInstanceTelemetryInfo(data []byte) (*InstanceTelemetryInfo, error)

func (*InstanceTelemetryInfo) MarshalJSON

func (info *InstanceTelemetryInfo) MarshalJSON() ([]byte, error)

type ParentInfo

type ParentInfo struct {
	ID     uuid.UUID `json:"id"`
	State  string    `json:"state"`
	Step   int       `json:"step"`
	Branch int       `json:"branch"` // NOTE: renamed iterator to branch
}

ParentInfo is part of the InstanceDescentInfo structure. It represents useful information about a single instance in the chain.

Jump to

Keyboard shortcuts

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