Documentation ¶
Index ¶
Constants ¶
const ( // Blockless Runtime flag names. RuntimeFlagEntry = "entry" RuntimeFlagExecutionTime = "run-time" RuntimeFlagDebug = "debug-info" RuntimeFlagFuel = "limited-fuel" RuntimeFlagMemory = "limited-memory" RuntimeFlagFSRoot = "fs-root-path" RuntimeFlagLogger = "runtime-logger" RuntimeFlagPermission = "permission" RuntimeFlagEnv = "env" )
const (
DefaultRuntimeEntryPoint = "_start"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Main peer.ID `json:"main,omitempty"` Peers []peer.ID `json:"peers,omitempty"` }
Cluster represents the set of peers that executed the request.
type Config ¶
type Config struct { Runtime RuntimeConfig `json:"runtime,omitempty"` Environment []EnvVar `json:"env_vars,omitempty"` Stdin *string `json:"stdin,omitempty"` Permissions []string `json:"permissions,omitempty"` ResultAggregation ResultAggregation `json:"result_aggregation,omitempty"` // NodeCount specifies how many nodes should execute this request. NodeCount int `json:"number_of_nodes,omitempty"` // Consensus algorithm to use. Raft and PBFT are supported at this moment. ConsensusAlgorithm string `json:"consensus_algorithm,omitempty"` // Threshold (percentage) defines how many nodes should respond with a result to consider this execution successful. Threshold float64 `json:"threshold,omitempty"` }
Config represents the configurable options for an execution request.
type EnvVar ¶
EnvVar represents the name and value of the environment variables set for the execution.
type ProcessID ¶
type ProcessID struct { PID int // PID can used to identify a process on all platforms. Handle uintptr // windows.Handle value that can be used for Windows-specific operations. }
ProcessID is used to identify an OS process.
type Request ¶
type Request struct { FunctionID string `json:"function_id"` Method string `json:"method"` Parameters []Parameter `json:"parameters,omitempty"` Config Config `json:"config"` // Optional signature of the request. Signature string `json:"signature,omitempty"` }
Request describes an execution request.
type Result ¶
type Result struct { Code codes.Code `json:"code"` Result RuntimeOutput `json:"result"` RequestID string `json:"request_id"` Usage Usage `json:"usage,omitempty"` }
Result describes an execution result.
type ResultAggregation ¶
type ResultMap ¶
ResultMap contains execution results from multiple peers.
func (ResultMap) MarshalJSON ¶
MarshalJSON provides means to correctly handle JSON serialization/deserialization. See:
https://github.com/libp2p/go-libp2p/pull/2156 https://github.com/libp2p/go-libp2p-resource-manager/pull/67#issuecomment-1176820561
type RuntimeConfig ¶
type RuntimeConfig struct { Entry string `json:"entry,omitempty"` ExecutionTime uint64 `json:"run_time,omitempty"` DebugInfo bool `json:"debug_info,omitempty"` Fuel uint64 `json:"limited_fuel,omitempty"` Memory uint64 `json:"limited_memory,omitempty"` Logger string `json:"runtime_logger,omitempty"` // Fields not allowed to be set in the request. Input string `json:"-"` FSRoot string `json:"-"` }
RuntimeConfig represents the CLI flags supported by the runtime
type RuntimeOutput ¶
type RuntimeOutput struct { Stdout string `json:"stdout"` Stderr string `json:"stderr"` ExitCode int `json:"exit_code"` Log string `json:"-"` }
RuntimeOutput describes the output produced by the Blockless Runtime during exection.
type Usage ¶
type Usage struct { WallClockTime time.Duration `json:"wall_clock_time,omitempty"` CPUUserTime time.Duration `json:"cpu_user_time,omitempty"` CPUSysTime time.Duration `json:"cpu_sys_time,omitempty"` MemoryMaxKB int64 `json:"memory_max_kb,omitempty"` }
Usage represents the resource usage information for a particular execution.