Documentation
¶
Index ¶
- Constants
- func ConsensusCommonPrefixAggregation[T any]() func() (ConsensusAggregation[[]T], error)
- func ConsensusCommonSuffixAggregation[T any]() func() (ConsensusAggregation[[]T], error)
- func DonModeCallInNodeMode() error
- func NodeModeCallInDonMode() error
- func ParseJSON[T any](bytes []byte) (*T, error)
- type CapabilityPromise
- type ConsensusAggregation
- type ExecutionHandler
- type NodeRuntime
- type NumericType
- type Primitive
- type Promise
- func NewBasicPromise[T any](await func() (T, error)) Promise[T]
- func PromiseFromResult[T any](result T, err error) Promise[T]
- func RunInNodeMode[C, T any](config C, runtime Runtime, ...) Promise[T]
- func Then[I, O any](p Promise[I], fn func(I) (O, error)) Promise[O]
- func ThenPromise[I, O any](p Promise[I], fn func(I) Promise[O]) Promise[O]
- type Report
- type ReportRequest
- type Runner
- type Runtime
- type RuntimeBase
- type Secret
- type SecretRequest
- type SecretsProvider
- type Trigger
- type Workflow
Constants ¶
View Source
const ( DefaultMaxResponseSizeBytes = 5 * 1024 * 1024 // 5 MB ResponseBufferTooSmall = "response buffer too small" // proto encoder outputs a map with these keys so that user payload can be easily extracted ReportMetadataHeaderLength = 109 )
Variables ¶
This section is empty.
Functions ¶
func ConsensusCommonPrefixAggregation ¶
func ConsensusCommonPrefixAggregation[T any]() func() (ConsensusAggregation[[]T], error)
func ConsensusCommonSuffixAggregation ¶
func ConsensusCommonSuffixAggregation[T any]() func() (ConsensusAggregation[[]T], error)
func DonModeCallInNodeMode ¶
func DonModeCallInNodeMode() error
func NodeModeCallInDonMode ¶
func NodeModeCallInDonMode() error
Types ¶
type CapabilityPromise ¶
type CapabilityPromise interface {
// contains filtered or unexported methods
}
type ConsensusAggregation ¶
type ConsensusAggregation[T any] interface { Descriptor() *sdk.ConsensusDescriptor Default() *T Err() error WithDefault(t T) ConsensusAggregation[T] }
func ConsensusAggregationFromTags ¶
func ConsensusAggregationFromTags[T any]() ConsensusAggregation[T]
func ConsensusIdenticalAggregation ¶
func ConsensusIdenticalAggregation[T any]() ConsensusAggregation[T]
func ConsensusMedianAggregation ¶
func ConsensusMedianAggregation[T NumericType]() ConsensusAggregation[T]
type ExecutionHandler ¶
type ExecutionHandler[C, R any] interface { CapabilityID() string Method() string TriggerCfg() *anypb.Any Callback() func(config C, runtime R, payload *anypb.Any) (any, error) }
ExecutionHandler is meant to be used internally by the SDK to define workflows.
type NodeRuntime ¶
type NodeRuntime interface {
RuntimeBase
IsNodeRuntime()
}
NodeRuntime is not thread safe and must not be used concurrently.
type NumericType ¶
type Primitive ¶
type Primitive interface {
NumericType | string | bool
}
type Promise ¶
type Promise[T any] interface { Await() (T, error) CapabilityPromise }
func NewBasicPromise ¶
func PromiseFromResult ¶
func RunInNodeMode ¶
func RunInNodeMode[C, T any]( config C, runtime Runtime, fn func(config C, nodeRuntime NodeRuntime) (T, error), ca ConsensusAggregation[T], ) Promise[T]
type Report ¶ added in v0.4.0
type Report struct {
// contains filtered or unexported fields
}
func X_GeneratedCodeOnly_WrapReport ¶ added in v0.4.0
func X_GeneratedCodeOnly_WrapReport(report *sdk.ReportResponse) (*Report, error)
X_GeneratedCodeOnly_Wrap is meant to be used by the code generator only.
func (*Report) X_GeneratedCodeOnly_Unwrap ¶ added in v0.4.0
func (r *Report) X_GeneratedCodeOnly_Unwrap() *sdk.ReportResponse
X_GeneratedCodeOnly_Unwrap is meant to be used by the code generator only.
type ReportRequest ¶ added in v0.6.0
type ReportRequest = sdk.ReportRequest
type Runtime ¶
type Runtime interface {
RuntimeBase
// RunInNodeMode is meant to be used by the helper method RunInNodeMode
RunInNodeMode(fn func(nodeRuntime NodeRuntime) *sdk.SimpleConsensusInputs) Promise[values.Value]
GenerateReport(*ReportRequest) Promise[*Report]
SecretsProvider
}
Runtime is not thread safe and must not be used concurrently.
type RuntimeBase ¶
type RuntimeBase interface {
// CallCapability is meant to be called by generated code
CallCapability(request *sdk.CapabilityRequest) Promise[*sdk.CapabilityResponse]
Rand() (*rand.Rand, error)
Logger() *slog.Logger
}
RuntimeBase is not thread safe and must not be used concurrently.
type SecretRequest ¶ added in v0.5.0
type SecretRequest = sdk.SecretRequest
type SecretsProvider ¶
type SecretsProvider interface {
GetSecret(*SecretRequest) Promise[*Secret]
}
type Workflow ¶
type Workflow[C any] []ExecutionHandler[C, Runtime]
Source Files
¶
Click to show internal directories.
Click to hide internal directories.