Documentation ¶
Index ¶
- Variables
- func DBExecutorFromContext(ctx context.Context) (sqlx.DBExecutor, bool)
- func EnvPrefixFromContext(ctx context.Context) (string, bool)
- func LoggerFromContext(ctx context.Context) (log.Logger, bool)
- func MustDBExecutorFromContext(ctx context.Context) sqlx.DBExecutor
- func MustEnvPrefixFromContext(ctx context.Context) string
- func MustLoggerFromContext(ctx context.Context) log.Logger
- func MustRedisPrefixFromContext(ctx context.Context) string
- func MustRuntimeResourceFromContext(ctx context.Context) *mapx.Map[uint32, []byte]
- func RedisPrefixFromContext(ctx context.Context) (string, bool)
- func RuntimeResourceFromContext(ctx context.Context) (*mapx.Map[uint32, []byte], bool)
- func WithChainClient(ctx context.Context, v *ChainClient) context.Context
- func WithChainClientContext(v *ChainClient) contextx.WithContext
- func WithDBExecutor(ctx context.Context, v sqlx.DBExecutor) context.Context
- func WithDBExecutorContext(v sqlx.DBExecutor) contextx.WithContext
- func WithEnv(ctx context.Context, v *Env) context.Context
- func WithEnvContext(v *Env) contextx.WithContext
- func WithEnvPrefix(ctx context.Context, v string) context.Context
- func WithEnvPrefixContext(v string) contextx.WithContext
- func WithKVStore(ctx context.Context, v KVStore) context.Context
- func WithKVStoreContext(v KVStore) contextx.WithContext
- func WithLogger(ctx context.Context, v log.Logger) context.Context
- func WithLoggerContext(v log.Logger) contextx.WithContext
- func WithRedisPrefix(ctx context.Context, v string) context.Context
- func WithRedisPrefixContext(v string) contextx.WithContext
- func WithRuntimeResource(ctx context.Context, v *mapx.Map[uint32, []byte]) context.Context
- func WithRuntimeResourceContext(v *mapx.Map[uint32, []byte]) contextx.WithContext
- type ABI
- type Cache
- type ChainClient
- func (c *ChainClient) Build() error
- func (c *ChainClient) CallContract(toStr, dataStr string) ([]byte, error)
- func (c *ChainClient) ConfigType() enums.ConfigType
- func (c *ChainClient) SendTX(toStr, valueStr, dataStr string) (string, error)
- func (c *ChainClient) WithContext(ctx context.Context) context.Context
- type Configuration
- type ContextHandler
- type CtxChainClient
- type CtxDBExecutor
- type CtxEnv
- type CtxEnvPrefix
- type CtxKVStore
- type CtxLogger
- type CtxRedisPrefix
- type CtxRuntimeResource
- type Env
- type EventConsumer
- type EventHandleResult
- type ExportsHandler
- type Handler
- type ImportsHandler
- type Instance
- type InstanceState
- type KVStore
- type Memory
- type Module
- type ResultStatusCode
- type Schema
- type VM
Constants ¶
This section is empty.
Variables ¶
View Source
var NameVersion = "w3bstream@v0.0.1"
Functions ¶
func DBExecutorFromContext ¶
func DBExecutorFromContext(ctx context.Context) (sqlx.DBExecutor, bool)
func EnvPrefixFromContext ¶ added in v1.0.0
func LoggerFromContext ¶ added in v1.0.0
func MustDBExecutorFromContext ¶
func MustDBExecutorFromContext(ctx context.Context) sqlx.DBExecutor
func MustEnvPrefixFromContext ¶ added in v1.0.0
func MustLoggerFromContext ¶ added in v1.0.0
func MustRedisPrefixFromContext ¶ added in v1.0.0
func MustRuntimeResourceFromContext ¶ added in v1.0.0
func RedisPrefixFromContext ¶ added in v1.0.0
func RuntimeResourceFromContext ¶ added in v1.0.0
func WithChainClient ¶ added in v1.0.0
func WithChainClient(ctx context.Context, v *ChainClient) context.Context
func WithChainClientContext ¶ added in v1.0.0
func WithChainClientContext(v *ChainClient) contextx.WithContext
func WithDBExecutor ¶
func WithDBExecutorContext ¶
func WithDBExecutorContext(v sqlx.DBExecutor) contextx.WithContext
func WithEnvContext ¶ added in v1.0.0
func WithEnvContext(v *Env) contextx.WithContext
func WithEnvPrefix ¶ added in v1.0.0
func WithEnvPrefixContext ¶ added in v1.0.0
func WithEnvPrefixContext(v string) contextx.WithContext
func WithKVStoreContext ¶ added in v1.0.0
func WithKVStoreContext(v KVStore) contextx.WithContext
func WithLogger ¶ added in v1.0.0
func WithLoggerContext ¶ added in v1.0.0
func WithLoggerContext(v log.Logger) contextx.WithContext
func WithRedisPrefix ¶ added in v1.0.0
func WithRedisPrefixContext ¶ added in v1.0.0
func WithRedisPrefixContext(v string) contextx.WithContext
func WithRuntimeResource ¶ added in v1.0.0
func WithRuntimeResourceContext ¶ added in v1.0.0
Types ¶
type ABI ¶
type ABI interface { Log(loglevel, ptr, size int32) int32 GetData(rid, vmAddrPtr, vmSizePtr int32) int32 SetData(rid, addr, size int32) int32 GetDB(kAddr, kSize, vmAddrPtr, vmSizePtr int32) int32 SetDB(kAddr, kSize, vAddr, vSize int32) int32 SendTX(offset, size int32) int32 CallContract(offset, size, vmAddrPtr, vmSizePtr int32) int32 SetSQLDB(addr, size int32) int32 GetSQLDB(addr, size, vmAddrPtr, vmSizePtr int32) int32 GetEnv(kAddr, kSize, vmAddrPtr, vmSizePtr int32) int32 }
type Cache ¶ added in v1.0.0
func DefaultCache ¶ added in v1.0.0
func DefaultCache() *Cache
func (*Cache) ConfigType ¶ added in v1.0.0
func (c *Cache) ConfigType() enums.ConfigType
type ChainClient ¶ added in v1.0.0
type ChainClient struct { PrivateKey string `json:"privateKey"` ChainEndpoint string `chainEndpoint:"chainEndpoint"` // contains filtered or unexported fields }
func ChainClientFromContext ¶ added in v1.0.0
func ChainClientFromContext(ctx context.Context) (*ChainClient, bool)
func MustChainClientFromContext ¶ added in v1.0.0
func MustChainClientFromContext(ctx context.Context) *ChainClient
func (*ChainClient) Build ¶
func (c *ChainClient) Build() error
func (*ChainClient) CallContract ¶ added in v1.0.0
func (c *ChainClient) CallContract(toStr, dataStr string) ([]byte, error)
func (*ChainClient) ConfigType ¶
func (c *ChainClient) ConfigType() enums.ConfigType
func (*ChainClient) SendTX ¶ added in v1.0.0
func (c *ChainClient) SendTX(toStr, valueStr, dataStr string) (string, error)
func (*ChainClient) WithContext ¶ added in v1.4.6
func (c *ChainClient) WithContext(ctx context.Context) context.Context
type Configuration ¶ added in v1.0.0
type Configuration interface { ConfigType() enums.ConfigType WithContext(context.Context) context.Context }
func NewConfigurationByType ¶ added in v1.0.0
func NewConfigurationByType(t enums.ConfigType) Configuration
type ContextHandler ¶
type ContextHandler interface { Name() string GetImports() ImportsHandler SetImports(ImportsHandler) GetExports() ExportsHandler GetInstance() Instance SetInstance(Instance) }
type CtxChainClient ¶ added in v1.0.0
type CtxChainClient struct{}
type CtxDBExecutor ¶
type CtxDBExecutor struct{}
type CtxEnvPrefix ¶ added in v1.0.0
type CtxEnvPrefix struct{}
type CtxKVStore ¶ added in v1.0.0
type CtxKVStore struct{}
type CtxRedisPrefix ¶ added in v1.0.0
type CtxRedisPrefix struct{}
type CtxRuntimeResource ¶ added in v1.0.0
type CtxRuntimeResource struct{}
type Env ¶ added in v1.0.0
type Env struct { Values [][2]string `json:"values"` // contains filtered or unexported fields }
func MustEnvFromContext ¶ added in v1.0.0
func (*Env) ConfigType ¶ added in v1.0.0
func (env *Env) ConfigType() enums.ConfigType
type EventConsumer ¶
type EventConsumer interface {
HandleEvent(ctx context.Context, handler string, payload []byte) *EventHandleResult
}
type EventHandleResult ¶
type EventHandleResult struct { InstanceID string `json:"instanceID"` Rsp []byte `json:"-"` Code ResultStatusCode `json:"code"` ErrMsg string `json:"errMsg"` }
type ExportsHandler ¶
type ExportsHandler interface { Start() Alloc() Free() }
type ImportsHandler ¶
type InstanceState ¶
type InstanceState = enums.InstanceState
type KVStore ¶
func KVStoreFromContext ¶ added in v1.0.0
func MustKVStoreFromContext ¶ added in v1.0.0
type ResultStatusCode ¶
type ResultStatusCode int32
ResultStatusCode wasm call result code
const ( ResultStatusCode_OK ResultStatusCode = iota ResultStatusCode_UnexportedHandler ResultStatusCode_ResourceNotFound ResultStatusCode_ImportNotFound ResultStatusCode_ImportCallFailed ResultStatusCode_TransDataToVMFailed ResultStatusCode_TransDataFromVMFailed ResultStatusCode_HostInternal ResultStatusCode_EnvKeyNotFound ResultStatusCode_NoDBContext // TODO following result status ResultStatusCode_Failed = -1 // reserved for wasm invoke failed )
type Schema ¶ added in v1.0.0
func (*Schema) ConfigType ¶ added in v1.0.0
func (s *Schema) ConfigType() enums.ConfigType
Source Files ¶
Click to show internal directories.
Click to hide internal directories.