Documentation ¶
Index ¶
- Constants
- Variables
- func GetArrayObjectId(arrayObj WaspObject, index int32, typeId int32, factory ObjFactory) int32
- func GetMapObjectId(mapObj WaspObject, keyId int32, typeId int32, factories ObjFactories) int32
- func GetProcessor(binaryCode []byte, logger *logger.Logger) (coretypes.Processor, error)
- func NewScViewState(ctxView coretypes.SandboxView) kv.KVStore
- func NewWasmProcessor(vm wasmhost.WasmVM, logger *logger.Logger) (*wasmProcessor, error)
- type BytesDecoder
- type BytesEncoder
- type ObjFactories
- type ObjFactory
- type ScContext
- func (o *ScContext) Exists(keyId int32, typeId int32) bool
- func (o *ScContext) GetBytes(keyId int32, typeId int32) []byte
- func (o *ScContext) GetObjectId(keyId int32, typeId int32) int32
- func (o *ScContext) GetTypeId(keyId int32) int32
- func (o *ScContext) SetBytes(keyId int32, typeId int32, bytes []byte)
- type ScDict
- func (o *ScDict) Exists(keyId int32, typeId int32) bool
- func (o *ScDict) FindOrMakeObjectId(keyId int32, factory ObjFactory) int32
- func (o *ScDict) GetBytes(keyId int32, typeId int32) []byte
- func (o *ScDict) GetObjectId(keyId int32, typeId int32) int32
- func (o *ScDict) GetTypeId(keyId int32) int32
- func (o *ScDict) InitObj(id int32, keyId int32, owner *ScDict)
- func (o *ScDict) Int64Bytes(value int64) []byte
- func (o *ScDict) MustInt64(bytes []byte) int64
- func (o *ScDict) NestedKey() string
- func (o *ScDict) Owner() WaspObject
- func (o *ScDict) Panic(format string, args ...interface{})
- func (o *ScDict) SetBytes(keyId int32, typeId int32, bytes []byte)
- func (o *ScDict) Suffix(keyId int32) string
- func (o *ScDict) Trace(format string, a ...interface{})
- type ScExports
- type ScMaps
- type ScSandboxObject
- type ScTransferInfo
- type ScTransfers
- type ScUtility
- func (o *ScUtility) Exists(keyId int32, typeId int32) bool
- func (o *ScUtility) GetBytes(keyId int32, typeId int32) []byte
- func (o *ScUtility) GetTypeId(keyId int32) int32
- func (o *ScUtility) InitObj(id int32, keyId int32, owner *ScDict)
- func (o *ScUtility) SetBytes(keyId int32, typeId int32, bytes []byte)
- type ScViewState
- func (s ScViewState) Del(key kv.Key)
- func (s ScViewState) Get(key kv.Key) ([]byte, error)
- func (s ScViewState) Has(key kv.Key) (bool, error)
- func (s ScViewState) Iterate(prefix kv.Key, f func(key kv.Key, value []byte) bool) error
- func (s ScViewState) IterateKeys(prefix kv.Key, f func(key kv.Key) bool) error
- func (s ScViewState) MustGet(key kv.Key) []byte
- func (s ScViewState) MustHas(key kv.Key) bool
- func (s ScViewState) MustIterate(prefix kv.Key, f func(key kv.Key, value []byte) bool)
- func (s ScViewState) MustIterateKeys(prefix kv.Key, f func(key kv.Key) bool)
- func (s ScViewState) Set(key kv.Key, value []byte)
- type WaspObject
Constants ¶
View Source
const ViewCopyAllState = "copy_all_state"
Variables ¶
View Source
var GoWasmVM wasmhost.WasmVM
View Source
var TestMode = false
Functions ¶
func GetArrayObjectId ¶
func GetArrayObjectId(arrayObj WaspObject, index int32, typeId int32, factory ObjFactory) int32
func GetMapObjectId ¶
func GetMapObjectId(mapObj WaspObject, keyId int32, typeId int32, factories ObjFactories) int32
func GetProcessor ¶
func NewScViewState ¶
func NewScViewState(ctxView coretypes.SandboxView) kv.KVStore
Types ¶
type BytesDecoder ¶
type BytesDecoder struct {
// contains filtered or unexported fields
}
func NewBytesDecoder ¶
func NewBytesDecoder(data []byte) *BytesDecoder
func (*BytesDecoder) Bytes ¶
func (d *BytesDecoder) Bytes() []byte
func (*BytesDecoder) Int64 ¶
func (d *BytesDecoder) Int64() int64
type BytesEncoder ¶
type BytesEncoder struct {
// contains filtered or unexported fields
}
func NewBytesEncoder ¶
func NewBytesEncoder() *BytesEncoder
func (*BytesEncoder) Bytes ¶
func (e *BytesEncoder) Bytes(value []byte) *BytesEncoder
func (*BytesEncoder) Data ¶
func (e *BytesEncoder) Data() []byte
func (*BytesEncoder) Int64 ¶
func (e *BytesEncoder) Int64(value int64) *BytesEncoder
type ObjFactories ¶
type ObjFactories map[int32]ObjFactory
type ObjFactory ¶
type ObjFactory func() WaspObject
type ScContext ¶
type ScContext struct {
ScSandboxObject
}
func NewScContext ¶
func NewScContext(vm *wasmProcessor) *ScContext
type ScDict ¶
type ScDict struct {
// contains filtered or unexported fields
}
func NewScBalances ¶
func NewScDictFromKvStore ¶
func NewScDictFromKvStore(host *wasmhost.KvStoreHost, kvStore kv.KVStore) *ScDict
func (*ScDict) FindOrMakeObjectId ¶
func (o *ScDict) FindOrMakeObjectId(keyId int32, factory ObjFactory) int32
func (*ScDict) Int64Bytes ¶
func (*ScDict) Owner ¶
func (o *ScDict) Owner() WaspObject
type ScExports ¶
type ScExports struct {
ScSandboxObject
}
func NewScExports ¶
func NewScExports(vm *wasmProcessor) *ScExports
type ScMaps ¶
type ScMaps struct {
ScSandboxObject
}
type ScSandboxObject ¶
type ScSandboxObject struct { ScDict // contains filtered or unexported fields }
func (*ScSandboxObject) GetBytes ¶
func (o *ScSandboxObject) GetBytes(keyId int32, typeId int32) []byte
func (*ScSandboxObject) GetObjectId ¶
func (o *ScSandboxObject) GetObjectId(keyId int32, typeId int32) int32
type ScTransferInfo ¶
type ScTransferInfo struct { ScSandboxObject // contains filtered or unexported fields }
func NewScTransferInfo ¶
func NewScTransferInfo(vm *wasmProcessor) *ScTransferInfo
func (*ScTransferInfo) Invoke ¶
func (o *ScTransferInfo) Invoke(balances int32)
type ScTransfers ¶
type ScTransfers struct {
ScSandboxObject
}
func NewScTransfers ¶
func NewScTransfers(vm *wasmProcessor) *ScTransfers
func (*ScTransfers) GetObjectId ¶
func (a *ScTransfers) GetObjectId(keyId int32, typeId int32) int32
type ScUtility ¶
type ScUtility struct { ScSandboxObject // contains filtered or unexported fields }
func NewScUtility ¶
func NewScUtility(vm *wasmProcessor) *ScUtility
type ScViewState ¶
type ScViewState struct {
// contains filtered or unexported fields
}
Wraps immutable view state into a mutable KVStore with the KVStoreWriter functions implemented as panics WaspLib already takes care of the immutability aspect, so these panics should never trigger and we can avoid a much more drastic refactoring for now
func (ScViewState) Del ¶
func (s ScViewState) Del(key kv.Key)
func (ScViewState) IterateKeys ¶
func (ScViewState) MustIterate ¶
func (ScViewState) MustIterateKeys ¶
type WaspObject ¶
type WaspObject interface { wasmhost.HostObject InitObj(id int32, keyId int32, owner *ScDict) Panic(format string, args ...interface{}) FindOrMakeObjectId(keyId int32, factory ObjFactory) int32 NestedKey() string Suffix(keyId int32) string }
func NewNullObject ¶
func NewNullObject(host *wasmhost.KvStoreHost) WaspObject
Click to show internal directories.
Click to hide internal directories.