flow

package
v17.3.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandlerContext

type EventHandlerContext interface {
	HTTPDo(reqURL string, method string, query *starlark.Dict, header *starlark.Dict, body starlark.Bytes) (starlark.Value, error)
	Select(cases *starlark.Dict, defaultCase starlark.Value, timeout startime.Duration, timeoutValue starlark.Value) (starlark.Value, error)
	Signal(workflowID string, signalName string, payloadJSON starlark.Value, runID string) (starlark.Value, error)
	SignalChannel(signalName string) ReceiveChannel
	Sleep(duration startime.Duration) (starlark.Value, error)
	Timer(duration startime.Duration) Future
}

TODO: eventually abstract starlark types away ... maybe?!

type Future

type Future interface {
	// TODO: support getting values out of it
	Get() error

	Unwrap() any
}

type FutureType

type FutureType struct {
	// contains filtered or unexported fields
}

func (*FutureType) CallInternal

func (f *FutureType) CallInternal(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

func (*FutureType) Freeze

func (f *FutureType) Freeze()

func (*FutureType) Hash

func (f *FutureType) Hash() (uint32, error)

func (*FutureType) Name

func (f *FutureType) Name() string

func (*FutureType) String

func (f *FutureType) String() string

func (*FutureType) Truth

func (f *FutureType) Truth() starlark.Bool

func (*FutureType) Type

func (f *FutureType) Type() string

func (*FutureType) Unwrap

func (f *FutureType) Unwrap() any

type ModuleRef

type ModuleRef struct {
	// SourceName is the name of the source to use to fetch this module.
	// Empty string means the entrypoint project.
	SourceName string
	File       string
}

func (ModuleRef) String

func (r ModuleRef) String() string

type ReceiveChannel

type ReceiveChannel interface {
	// TODO: is this interface copied form temporal really the best one?
	Receive(payloadJSON *string) bool /* more */

	Unwrap() any
}

type ReceiveChannelType

type ReceiveChannelType struct {
	// contains filtered or unexported fields
}

func (*ReceiveChannelType) Attr

func (c *ReceiveChannelType) Attr(name string) (starlark.Value, error)

func (*ReceiveChannelType) AttrNames

func (c *ReceiveChannelType) AttrNames() []string

func (*ReceiveChannelType) Freeze

func (c *ReceiveChannelType) Freeze()

func (*ReceiveChannelType) Hash

func (c *ReceiveChannelType) Hash() (uint32, error)

func (*ReceiveChannelType) String

func (c *ReceiveChannelType) String() string

func (*ReceiveChannelType) Truth

func (c *ReceiveChannelType) Truth() starlark.Bool

func (*ReceiveChannelType) Type

func (c *ReceiveChannelType) Type() string

func (*ReceiveChannelType) Unwrap

func (c *ReceiveChannelType) Unwrap() any

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntimeFromSource

func NewRuntimeFromSource(ctx context.Context, opts RuntimeOptions) (*Runtime, error)

func (*Runtime) EvaluateEventHandlerIds

func (r *Runtime) EvaluateEventHandlerIds(typ string, event *starlark.Dict) ([]string, error)

func (*Runtime) Execute

func (r *Runtime) Execute(eventType string, eventHandlerID uint32, ctx EventHandlerContext, vars starlark.StringDict, event *starlark.Dict) error

type RuntimeOptions

type RuntimeOptions struct {
	Source      Source
	ProjectPath string
	Entrypoint  string
	PrintFunc   func(*starlark.Thread, string)
	NowFunc     func() time.Time
}

type Source

type Source interface {
	// SetupThreadLocal configures thread local variables for this source.
	// projectPath is GitLab project path of the entrypoint project.
	SetupThreadLocal(thread *starlark.Thread, projectPath string)
	// RecordSource
	// fullGitRef is the full git reference:
	// - refs/heads/<name> for branches
	// - refs/tags/<name> for tags
	// - <commit id> for commits
	// - empty string or HEAD to use the default branch.
	RecordSource(thread *starlark.Thread, name, projectPath, fullGitRef string) error
	LoadFile(ctx context.Context, thread *starlark.Thread, ref ModuleRef) ([]byte, error)
}

Jump to

Keyboard shortcuts

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