Documentation ¶
Index ¶
- Constants
- type Argument
- type BaseArgument
- type BaseValueArgument
- type Heap
- func (h *Heap) Clear() error
- func (h *Heap) ReadBytes(ptr int32, length int32) []byte
- func (h *Heap) ReadString(ptr int32, length int32) string
- func (h *Heap) Write(bytes []byte, from string) (int32, error)
- func (h *Heap) WriteAndTrack(bytes []byte, track bool, from string) (int32, error)
- func (h *Heap) WriteAtPtr(bytes []byte, ptr int32, from string) (int32, error)
- type InputType
- type Instance
- func (i *Instance) Cleanup() error
- func (i *Instance) Err() error
- func (i *Instance) Execute() (err error)
- func (i *Instance) ExecuteWithArgs(args ...interface{}) (err error)
- func (i *Instance) Output() []byte
- func (i *Instance) PushExecutionStack(event string)
- func (i *Instance) ReachedLogsMaxByteCount() bool
- func (i *Instance) SetOutputStore(store store.Store)
- func (i *Instance) WriteOutputToHeap(outputPtr int32, value []byte, from string) error
- type MapInput
- type Module
- type PanicError
- type Runtime
- type SourceInput
- type StoreDeltaInput
- type StoreReaderInput
- type StoreWriterOutput
- type ValueArgument
- type WASMExtension
- type WASMExtensioner
Constants ¶
View Source
const ClockType = "sf.substreams.v1.Clock"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseArgument ¶ added in v0.0.21
type BaseArgument struct {
// contains filtered or unexported fields
}
func (*BaseArgument) Name ¶ added in v0.0.21
func (b *BaseArgument) Name() string
type BaseValueArgument ¶ added in v0.0.21
type BaseValueArgument struct {
// contains filtered or unexported fields
}
func (*BaseValueArgument) SetValue ¶ added in v0.0.21
func (b *BaseValueArgument) SetValue(data []byte)
func (*BaseValueArgument) Value ¶ added in v0.0.21
func (b *BaseValueArgument) Value() []byte
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
func (*Heap) WriteAndTrack ¶ added in v0.0.19
type Instance ¶
type Instance struct { Logs []string LogsByteCount uint64 ExecutionStack []string Module *Module // contains filtered or unexported fields }
func (*Instance) ExecuteWithArgs ¶
func (*Instance) PushExecutionStack ¶ added in v0.0.19
func (*Instance) ReachedLogsMaxByteCount ¶
func (*Instance) SetOutputStore ¶
type MapInput ¶ added in v0.0.21
type MapInput struct { BaseArgument BaseValueArgument }
func NewMapInput ¶ added in v0.0.21
type Module ¶
type Module struct { CurrentInstance *Instance Heap *Heap // contains filtered or unexported fields }
func (*Module) NewInstance ¶
type PanicError ¶
type PanicError struct {
// contains filtered or unexported fields
}
func (*PanicError) Error ¶
func (e *PanicError) Error() string
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(extensions []WASMExtensioner) *Runtime
type SourceInput ¶ added in v0.0.21
type SourceInput struct { BaseArgument BaseValueArgument }
func NewSourceInput ¶ added in v0.0.21
func NewSourceInput(name string) *SourceInput
type StoreDeltaInput ¶ added in v0.0.21
type StoreDeltaInput struct { BaseArgument BaseValueArgument }
func NewStoreDeltaInput ¶ added in v0.0.21
func NewStoreDeltaInput(name string) *StoreDeltaInput
type StoreReaderInput ¶ added in v0.0.21
type StoreReaderInput struct { BaseArgument Store store.Store }
func NewStoreReaderInput ¶ added in v0.0.21
func NewStoreReaderInput(name string, store store.Store) *StoreReaderInput
type StoreWriterOutput ¶ added in v0.0.21
type StoreWriterOutput struct { BaseArgument Store store.Store UpdatePolicy pbsubstreams.Module_KindStore_UpdatePolicy ValueType string }
func NewStoreWriterOutput ¶ added in v0.0.21
func NewStoreWriterOutput(name string, store store.Store, updatePolicy pbsubstreams.Module_KindStore_UpdatePolicy, valueType string) *StoreWriterOutput
type ValueArgument ¶ added in v0.0.21
type WASMExtension ¶
type WASMExtension func(ctx context.Context, request *pbsubstreams.Request, clock *pbsubstreams.Clock, in []byte) (out []byte, err error)
WASMExtension defines the implementation of a function that will be exposed as wasm imports; therefore, exposed to the host language like Rust.
For example, this can be an RPC call, taking a structured request in `in` and outputting a structured response in `out`, both serialized as protobuf messages.
Such a function needs to be registered through RegisterRuntime.
type WASMExtensioner ¶
type WASMExtensioner interface {
WASMExtensions() map[string]map[string]WASMExtension
}
Click to show internal directories.
Click to hide internal directories.