Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API provides REST API functionality for the Blockless head node.
func New ¶
New creates a new instance of a Blockless head node REST API. Access to node data is provided by the provided `node`.
func (*API) ExecutionResult ¶
ExecutionResult implements the REST API endpoint for retrieving the result of a function execution.
type ExecuteRequest ¶
ExecuteRequest describes the payload for the REST API request for function execution.
type ExecuteResponse ¶
type ExecuteResponse struct {
Code codes.Code `json:"code,omitempty"`
RequestID string `json:"request_id,omitempty"`
Message string `json:"message,omitempty"`
Results aggregate.Results `json:"results,omitempty"`
Cluster execute.Cluster `json:"cluster,omitempty"`
}
ExecuteResponse describes the REST API response for function execution.
type ExecuteResult ¶
type ExecuteResult struct {
Code codes.Code `json:"code,omitempty"`
Result execute.RuntimeOutput `json:"result,omitempty"`
RequestID string `json:"request_id,omitempty"`
}
ExecuteResult represents the API representation of a single execution response. It is similar to the model in `execute.Result`, except it omits the usage information for now.
type ExecutionResultRequest ¶
type ExecutionResultRequest struct {
ID string `json:"id"`
}
ExecutionResultRequest describes the payload for the REST API request for execution result.
type InstallFunctionRequest ¶
type InstallFunctionRequest struct {
CID string `json:"cid"`
URI string `json:"uri"`
Subgroup string `json:"subgroup"`
}
InstallFunctionRequest describes the payload for the REST API request for function install.
type InstallFunctionResponse ¶
type InstallFunctionResponse struct {
Code string `json:"code"`
}
InstallFunctionResponse describes the REST API response for the function install.
type Node ¶
type Node interface {
ExecuteFunction(ctx context.Context, req execute.Request, subgroup string) (code codes.Code, requestID string, results execute.ResultMap, peers execute.Cluster, err error)
ExecutionResult(id string) (execute.Result, bool)
PublishFunctionInstall(ctx context.Context, uri string, cid string, subgroup string) error
}