sdkimpl

package
v1.22.0-capdev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeRuntime

type NodeRuntime struct {
	RuntimeBase
}

func (*NodeRuntime) IsNodeRuntime

func (n *NodeRuntime) IsNodeRuntime()

type Runtime

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

func (*Runtime) GenerateReport added in v0.2.0

func (d *Runtime) GenerateReport(request *sdk.ReportRequest) cre.Promise[*cre.Report]

func (*Runtime) GetSecret

func (d *Runtime) GetSecret(req *sdk.SecretRequest) cre.Promise[*sdk.Secret]

func (*Runtime) GetSecrets added in v1.16.0

func (d *Runtime) GetSecrets(reqs []*sdk.SecretRequest) cre.Promise[[]*sdk.Secret]

func (*Runtime) RunInNodeMode

func (d *Runtime) RunInNodeMode(fn func(nodeRuntime cre.NodeRuntime) *sdk.SimpleConsensusInputs) cre.Promise[values.Value]

RunInNodeMode switches the runtime into node mode, runs fn, then switches back to DON mode. It modifies the shared modeErr and Mode fields without synchronization; this is safe because the runtime is single-threaded by design (see the RuntimeBase godoc) and must not be used concurrently.

type RuntimeBase

type RuntimeBase struct {
	ExecutionMeta   cre.WorkflowExecutionMetadata
	MaxResponseSize uint64
	RuntimeHelpers
	Lggr *slog.Logger

	Mode sdk.Mode
	// contains filtered or unexported fields
}

RuntimeBase is the internal implementation of cre.RuntimeBase.

It is not thread safe and must not be used concurrently. The runtime is designed to execute within a single-threaded WASM guest environment, so the call ID counter (nextCallId) and mode state (modeErr, Mode) are intentionally unsynchronized. Concurrent access would race on that state.

func (*RuntimeBase) CallCapability

func (r *RuntimeBase) CallCapability(request *sdk.CapabilityRequest) cre.Promise[*sdk.CapabilityResponse]

func (*RuntimeBase) ExecutionMetadata

func (r *RuntimeBase) ExecutionMetadata() cre.WorkflowExecutionMetadata

func (*RuntimeBase) Int63

func (r *RuntimeBase) Int63() int64

func (*RuntimeBase) Logger added in v0.5.0

func (r *RuntimeBase) Logger() *slog.Logger

func (*RuntimeBase) Now added in v0.7.0

func (r *RuntimeBase) Now() time.Time

func (*RuntimeBase) Rand

func (r *RuntimeBase) Rand() (*rand.Rand, error)

func (*RuntimeBase) Seed

func (r *RuntimeBase) Seed(seed int64)

func (*RuntimeBase) SetExecutionRequest

func (r *RuntimeBase) SetExecutionRequest(request *sdk.ExecuteRequest)

SetExecutionRequest initializes the runtime from a host invocation, clearing metadata when an older host does not supply it.

func (*RuntimeBase) Uint64

func (r *RuntimeBase) Uint64() uint64

type RuntimeHelpers

type RuntimeHelpers interface {
	Call(request *sdk.CapabilityRequest) error
	Await(request *sdk.AwaitCapabilitiesRequest, maxResponseSize uint64) (*sdk.AwaitCapabilitiesResponse, error)

	GetSecrets(request *sdk.GetSecretsRequest, maxResponseSize uint64) error
	AwaitSecrets(request *sdk.AwaitSecretsRequest, maxResponseSize uint64) (*sdk.AwaitSecretsResponse, error)

	SwitchModes(mode sdk.Mode)
	GetSource(mode sdk.Mode) rand.Source

	Now() time.Time
}

type TeeRuntime added in v1.18.0

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

func NewTeeRuntime added in v1.18.0

func NewTeeRuntime(don *Runtime) *TeeRuntime

func (*TeeRuntime) CallCapability added in v1.18.0

func (t *TeeRuntime) CallCapability(request *sdk.CapabilityRequest) cre.Promise[*sdk.CapabilityResponse]

func (*TeeRuntime) ExecutionMetadata

func (t *TeeRuntime) ExecutionMetadata() cre.WorkflowExecutionMetadata

func (*TeeRuntime) GetSecret added in v1.18.0

func (t *TeeRuntime) GetSecret(req *sdk.SecretRequest) cre.Promise[*sdk.Secret]

func (*TeeRuntime) GetSecrets added in v1.18.0

func (t *TeeRuntime) GetSecrets(reqs []*sdk.SecretRequest) cre.Promise[[]*sdk.Secret]

func (*TeeRuntime) Logger added in v1.18.0

func (t *TeeRuntime) Logger() *slog.Logger

func (*TeeRuntime) Now added in v1.18.0

func (t *TeeRuntime) Now() time.Time

func (*TeeRuntime) Rand added in v1.18.0

func (t *TeeRuntime) Rand() (*rand.Rand, error)

func (*TeeRuntime) ReportFromDon added in v1.18.0

func (t *TeeRuntime) ReportFromDon(request *cre.ReportRequest) cre.Promise[*cre.Report]

func (*TeeRuntime) UsingTheDons added in v1.18.0

func (t *TeeRuntime) UsingTheDons() cre.Runtime

Jump to

Keyboard shortcuts

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