Documentation ¶
Index ¶
Constants ¶
View Source
const ( EndpointSpec = "/v1/spec" EndpointExecute = "/v1/exec" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a ranna client
func (*Client) Execute ¶
func (client *Client) Execute(executionRequest *ExecutionRequest) (*ExecutionResponse, error)
Execute executes a code snippet using ranna
type Error ¶
type Error struct { Message string `json:"error"` Code int `json:"code"` Context string `json:"context"` }
Error represents a ranna API error
type ExecutionRequest ¶
type ExecutionRequest struct { Language string `json:"language"` Code string `json:"code"` Arguments []string `json:"arguments"` Environment map[string]string `json:"environment"` }
ExecutionRequest is being sent to ranna to execute a code snippet
type ExecutionResponse ¶
type ExecutionResponse struct { StdOut string `json:"stdout"` StdErr string `json:"stderr"` // Duration represents the duration ranna took to execute the requested snippet // Please note that this is not 100% accurate as this is calculated on the client side Duration time.Duration `json:"-"` }
ExecutionResponse represents a response of a ranna code execution
Click to show internal directories.
Click to hide internal directories.