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 Environment
- type ExecutionHandler
- type NodeEnvironment
- type NodeRuntime
- type NumericType
- type Primitive
- type Promise
- type Runner
- type Runtime
- type RuntimeBase
- 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 ConsensusResponseMapKeyMetadata = "metadata" ConsensusResponseMapKeyPayload = "payload" )
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() *pb.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 Environment ¶
type Environment[C any] struct { NodeEnvironment[C] SecretsProvider }
type ExecutionHandler ¶
type ExecutionHandler[C, R any] interface { CapabilityID() string Method() string TriggerCfg() *anypb.Any Callback() func(env *Environment[C], runtime R, payload *anypb.Any) (any, error) }
ExecutionHandler is meant to be used internally by the SDK to define workflows.
type NodeEnvironment ¶
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]( env *Environment[C], runtime Runtime, fn func(env *NodeEnvironment[C], nodeRuntime NodeRuntime) (T, error), cd ConsensusAggregation[T]) Promise[T]
type Runner ¶
type Runner[C any] interface { Run(initFn func(env *Environment[C]) (Workflow[C], error)) }
type Runtime ¶
type Runtime interface {
RuntimeBase
// RunInNodeMode is meant to be used by the helper method RunInNodeMode
RunInNodeMode(fn func(nodeRuntime NodeRuntime) *pb.SimpleConsensusInputs) Promise[values.Value]
}
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 *pb.CapabilityRequest) Promise[*pb.CapabilityResponse]
Rand() (*rand.Rand, error)
}
RuntimeBase is not thread safe and must not be used concurrently.
type SecretsProvider ¶
type SecretsProvider interface {
GetSecret(*sdkpb.SecretRequest) Promise[*sdkpb.Secret]
}
type Workflow ¶
type Workflow[C any] []ExecutionHandler[C, Runtime]
Source Files
¶
Click to show internal directories.
Click to hide internal directories.