Documentation
¶
Index ¶
- type NodeRuntime
- type Runtime
- func (d *Runtime) GenerateReport(request *sdk.ReportRequest) cre.Promise[*cre.Report]
- func (d *Runtime) GetSecret(req *sdk.SecretRequest) cre.Promise[*sdk.Secret]
- func (d *Runtime) GetSecrets(reqs []*sdk.SecretRequest) cre.Promise[[]*sdk.Secret]
- func (d *Runtime) RunInNodeMode(fn func(nodeRuntime cre.NodeRuntime) *sdk.SimpleConsensusInputs) cre.Promise[values.Value]
- type RuntimeBase
- func (r *RuntimeBase) CallCapability(request *sdk.CapabilityRequest) cre.Promise[*sdk.CapabilityResponse]
- func (r *RuntimeBase) Int63() int64
- func (r *RuntimeBase) Logger() *slog.Logger
- func (r *RuntimeBase) Now() time.Time
- func (r *RuntimeBase) Rand() (*rand.Rand, error)
- func (r *RuntimeBase) Seed(seed int64)
- func (r *RuntimeBase) Uint64() uint64
- type RuntimeHelpers
- type TeeRuntime
- func (t *TeeRuntime) CallCapability(request *sdk.CapabilityRequest) cre.Promise[*sdk.CapabilityResponse]
- func (t *TeeRuntime) GetSecret(req *sdk.SecretRequest) cre.Promise[*sdk.Secret]
- func (t *TeeRuntime) GetSecrets(reqs []*sdk.SecretRequest) cre.Promise[[]*sdk.Secret]
- func (t *TeeRuntime) Logger() *slog.Logger
- func (t *TeeRuntime) Now() time.Time
- func (t *TeeRuntime) Rand() (*rand.Rand, error)
- func (t *TeeRuntime) ReportFromDon(request *cre.ReportRequest) cre.Promise[*cre.Report]
- func (t *TeeRuntime) UsingTheDons() cre.Runtime
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 (*Runtime) GetSecrets ¶ added in v1.16.0
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 {
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) 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) Seed ¶
func (r *RuntimeBase) Seed(seed int64)
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) 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) 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