Documentation
¶
Index ¶
- Variables
- type Executor
- type FStore
- type Node
- type PeerStore
- type Store
- func (s *Store) Delete(key string) error
- func (s *Store) Get(key string) (string, error)
- func (s *Store) GetRecord(key string, value interface{}) error
- func (s *Store) Keys() ([]string, error)
- func (s *Store) Set(key string, value string) error
- func (s *Store) SetRecord(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoopLogger = zerolog.New(io.Discard) GenericError = errors.New("dummy error") GenericPeerID = peer.ID([]byte{0x0, 0x24, 0x8, 0x1, 0x12, 0x20, 0x56, 0x77, 0x86, 0x82, 0x76, 0xa, 0xc5, 0x9, 0x63, 0xde, 0xe4, 0x31, 0xfc, 0x44, 0x75, 0xdd, 0x5a, 0x27, 0xee, 0x6b, 0x94, 0x13, 0xed, 0xe2, 0xa3, 0x6d, 0x8a, 0x1d, 0x57, 0xb6, 0xb8, 0x91}) GenericAddress = "/ip4/127.0.0.1/tcp/9000/p2p/12D3KooWRp3AVk7qtc2Av6xiqgAza1ZouksQaYcS2cvN94kHSCoa" GenericString = "test" GenericUUID = uuid.UUID{0xd1, 0xc2, 0x44, 0xaf, 0xa3, 0x1d, 0x48, 0x87, 0x93, 0x9d, 0xd6, 0xc7, 0xf, 0xe, 0x4f, 0xd0} GenericExecutionResult = execute.Result{ Code: codes.Unknown, Result: execute.RuntimeOutput{ Stdout: "generic-execution-result", Stderr: "generic-execution-log", ExitCode: 0, }, RequestID: GenericUUID.String(), } GenericExecutionRequest = execute.Request{ FunctionID: "generic-function-id", Method: "wasm", Parameters: []execute.Parameter{ { Name: "generic-param-name", Value: "generic-param-value", }, }, } GenericManifest = blockless.FunctionManifest{ ID: "generic-id", Name: "generic-name", Description: "generic-description", Function: blockless.Function{ ID: "function-id", Name: "function-name", Runtime: "generic-runtime", }, Deployment: blockless.Deployment{ CID: "generic-cid", Checksum: "1234567890", URI: "generic-uri", }, FSRootPath: "/var/tmp/blockless/", Entry: "/var/tmp/blockless/app.wasm", } )
Global variables that can be used for testing. They are valid non-nil values for commonly needed types.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
func BaselineExecutor ¶
type FStore ¶
type FStore struct {
InstallFunc func(string, string) error
GetFunc func(string) (*blockless.FunctionManifest, error)
InstalledFunc func(string) (bool, error)
InstalledFunctionsFunc func() ([]string, error)
SyncFunc func(string) error
}
func BaselineFStore ¶
func (*FStore) InstalledFunctions ¶
type Node ¶
type Node struct {
ExecuteFunctionFunc func(context.Context, execute.Request) (codes.Code, string, execute.ResultMap, execute.Cluster, error)
ExecutionResultFunc func(id string) (execute.Result, bool)
PublishFunctionInstallFunc func(ctx context.Context, uri string, cid string) error
}
Node implements the `Node` interface expected by the API.
func BaselineNode ¶
func (*Node) ExecuteFunction ¶
type PeerStore ¶
type PeerStore struct {
GetFunc func(peer.ID) (blockless.Peer, error)
StoreFunc func(peer.ID, multiaddr.Multiaddr, peer.AddrInfo) error
PeersFunc func() ([]blockless.Peer, error)
RemoveFunc func(peer.ID) error
}
func BaselinePeerStore ¶
type Store ¶
type Store struct {
GetFunc func(key string) (string, error)
SetFunc func(key string, value string) error
GetRecordFunc func(key string, value interface{}) error
SetRecordFunc func(key string, value interface{}) error
DeleteFunc func(key string) error
KeysFunc func() ([]string, error)
}
func BaselineStore ¶
Click to show internal directories.
Click to hide internal directories.