Documentation
¶
Index ¶
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type CommandExecFuncParams
- type CommandExecFuncParamsFile
- type CommandExecFuncParamsHTTP
- type CommandExecFuncParamsHTTPAllow
- type CommandExecFuncParamsHTTPAllowAuth
- type CommandExecFuncParamsHTTPAllowAuthBasic
- type CommandExecFuncParamsHTTPAllowAuthBearer
- type CommandExecFuncParamsHTTPAllowAuthHeader
- type CommandExecFuncParamsHTTPAllowAuthQuery
- type CommandExecFuncParamsLanguage
- type CommandExecFuncParamsLimits
- type CommandExecFuncResponse
- type CommandExecFuncResponseExecution
- type CommandExecFuncResponseOutputStatus
- type CommandExecParams
- type CommandExecParamsFile
- type CommandExecParamsHTTP
- type CommandExecParamsHTTPAllow
- type CommandExecParamsHTTPAllowAuth
- type CommandExecParamsHTTPAllowAuthBasic
- type CommandExecParamsHTTPAllowAuthBearer
- type CommandExecParamsHTTPAllowAuthHeader
- type CommandExecParamsHTTPAllowAuthQuery
- type CommandExecParamsLanguage
- type CommandExecParamsLimits
- type CommandExecResponse
- type CommandService
- type Error
- type Execution
- type ExecutionDetails
- type ExecutionDetailsFunctionExecutionDetails
- type ExecutionDetailsFunctionExecutionDetailsRequest
- type ExecutionDetailsFunctionExecutionDetailsRequestFile
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTP
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader
- type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery
- type ExecutionDetailsFunctionExecutionDetailsRequestLanguage
- type ExecutionDetailsFunctionExecutionDetailsRequestLimits
- type ExecutionDetailsFunctionExecutionDetailsResponse
- type ExecutionDetailsFunctionExecutionDetailsResponseExecution
- type ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus
- type ExecutionDetailsFunctionExecutionDetailsType
- type ExecutionDetailsScriptExecutionDetails
- type ExecutionDetailsScriptExecutionDetailsRequest
- type ExecutionDetailsScriptExecutionDetailsRequestFile
- type ExecutionDetailsScriptExecutionDetailsRequestHTTP
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader
- type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery
- type ExecutionDetailsScriptExecutionDetailsRequestLanguage
- type ExecutionDetailsScriptExecutionDetailsRequestLimits
- type ExecutionDetailsScriptExecutionDetailsResponse
- type ExecutionDetailsScriptExecutionDetailsType
- type ExecutionDetailsToolExecutionDetails
- type ExecutionDetailsToolExecutionDetailsRequest
- type ExecutionDetailsToolExecutionDetailsRequestEnv
- type ExecutionDetailsToolExecutionDetailsRequestHTTP
- type ExecutionDetailsToolExecutionDetailsRequestHTTPAllow
- type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth
- type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic
- type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer
- type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery
- type ExecutionDetailsToolExecutionDetailsResponse
- type ExecutionDetailsToolExecutionDetailsResponseExecution
- type ExecutionDetailsToolExecutionDetailsResponseOutputStatus
- type ExecutionDetailsToolExecutionDetailsType
- type ExecutionDetailsType
- type ExecutionDetailsUnion
- type ExecutionLanguage
- type ExecutionListParams
- type ExecutionService
- func (r *ExecutionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Execution, err error)
- func (r *ExecutionService) List(ctx context.Context, query ExecutionListParams, opts ...option.RequestOption) (res *pagination.DefaultPagination[Execution], err error)
- func (r *ExecutionService) ListAutoPaging(ctx context.Context, query ExecutionListParams, opts ...option.RequestOption) *pagination.DefaultPaginationAutoPager[Execution]
- type Revision
- type RevisionManifestFile
- type RevisionManifestFileName
- type RevisionStatus
- type Runtime
- type RuntimeDeleteResponse
- type RuntimeEngine
- type RuntimeLanguage
- type RuntimeListParams
- type RuntimeManifestFile
- type RuntimeManifestFileName
- type RuntimeNewParams
- type RuntimeNewParamsEngine
- type RuntimeNewParamsLanguage
- type RuntimeNewParamsManifestFile
- type RuntimeNewParamsManifestFileName
- type RuntimeRevisionListResponse
- type RuntimeRevisionNewParams
- type RuntimeRevisionNewParamsManifestFile
- type RuntimeRevisionNewParamsManifestFileName
- type RuntimeRevisionService
- func (r *RuntimeRevisionService) Get(ctx context.Context, runtimeID string, revisionID string, ...) (res *Revision, err error)
- func (r *RuntimeRevisionService) List(ctx context.Context, id string, opts ...option.RequestOption) (res *RuntimeRevisionListResponse, err error)
- func (r *RuntimeRevisionService) New(ctx context.Context, id string, body RuntimeRevisionNewParams, ...) (res *Revision, err error)
- type RuntimeService
- func (r *RuntimeService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *RuntimeDeleteResponse, err error)
- func (r *RuntimeService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Runtime, err error)
- func (r *RuntimeService) List(ctx context.Context, query RuntimeListParams, opts ...option.RequestOption) (res *pagination.RuntimesPagination[Runtime], err error)
- func (r *RuntimeService) ListAutoPaging(ctx context.Context, query RuntimeListParams, opts ...option.RequestOption) *pagination.RuntimesPaginationAutoPager[Runtime]
- func (r *RuntimeService) New(ctx context.Context, body RuntimeNewParams, opts ...option.RequestOption) (res *Runtime, err error)
- type RuntimeStatus
- type Secret
- type SecretListParams
- type SecretNewParams
- type SecretService
- func (r *SecretService) List(ctx context.Context, query SecretListParams, opts ...option.RequestOption) (res *pagination.SecretsPagination[Secret], err error)
- func (r *SecretService) ListAutoPaging(ctx context.Context, query SecretListParams, opts ...option.RequestOption) *pagination.SecretsPaginationAutoPager[Secret]
- func (r *SecretService) New(ctx context.Context, body SecretNewParams, opts ...option.RequestOption) (res *Secret, err error)
- type Tool
- type ToolExecParams
- type ToolExecParamsEnv
- type ToolExecParamsHTTP
- type ToolExecParamsHTTPAllow
- type ToolExecParamsHTTPAllowAuth
- type ToolExecParamsHTTPAllowAuthBasic
- type ToolExecParamsHTTPAllowAuthBearer
- type ToolExecParamsHTTPAllowAuthQuery
- type ToolExecResponse
- type ToolExecResponseExecution
- type ToolExecResponseOutputStatus
- type ToolLanguage
- type ToolListParams
- type ToolNewParams
- type ToolNewParamsLanguage
- type ToolService
- func (r *ToolService) Exec(ctx context.Context, id string, body ToolExecParams, ...) (res *ToolExecResponse, err error)
- func (r *ToolService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Tool, err error)
- func (r *ToolService) List(ctx context.Context, query ToolListParams, opts ...option.RequestOption) (res *pagination.ToolsPagination[Tool], err error)
- func (r *ToolService) ListAutoPaging(ctx context.Context, query ToolListParams, opts ...option.RequestOption) *pagination.ToolsPaginationAutoPager[Tool]
- func (r *ToolService) New(ctx context.Context, body ToolNewParams, opts ...option.RequestOption) (res *Tool, err error)
- func (r *ToolService) Update(ctx context.Context, id string, body ToolUpdateParams, ...) (res *Tool, err error)
- type ToolUpdateParams
- type ToolUpdateParamsLanguage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶ added in v0.10.0
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (RIZA_API_KEY, RIZA_BASE_URL). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type Client ¶
type Client struct { Options []option.RequestOption Secrets *SecretService Tools *ToolService Command *CommandService Runtimes *RuntimeService Executions *ExecutionService }
Client creates a struct with services and top level methods that help with interacting with the riza API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (RIZA_API_KEY, RIZA_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CommandExecFuncParams ¶ added in v0.7.0
type CommandExecFuncParams struct { // The function to execute. Your code must define a function named "execute" that // takes in a single argument and returns a JSON-serializable value. Code param.Field[string] `json:"code,required"` // The interpreter to use when executing code. Language param.Field[CommandExecFuncParamsLanguage] `json:"language,required"` // Set of key-value pairs to add to the function's execution environment. Env param.Field[map[string]string] `json:"env"` // List of input files. Files param.Field[[]CommandExecFuncParamsFile] `json:"files"` // Configuration for HTTP requests and authentication. HTTP param.Field[CommandExecFuncParamsHTTP] `json:"http"` // The input to the function. This must be a valid JSON-serializable object. If you // do not pass an input, your function will be called with None (Python) or null // (JavaScript/TypeScript) as the argument. Input param.Field[interface{}] `json:"input"` // Configuration for execution environment limits. Limits param.Field[CommandExecFuncParamsLimits] `json:"limits"` // The ID of the runtime revision to use when executing code. RuntimeRevisionID param.Field[string] `json:"runtime_revision_id"` }
func (CommandExecFuncParams) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParams) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsFile ¶ added in v0.7.0
type CommandExecFuncParamsFile struct { // The contents of the file. Contents param.Field[string] `json:"contents"` // The relative path of the file. Path param.Field[string] `json:"path"` }
func (CommandExecFuncParamsFile) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsFile) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTP ¶ added in v0.7.0
type CommandExecFuncParamsHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow param.Field[[]CommandExecFuncParamsHTTPAllow] `json:"allow"` }
Configuration for HTTP requests and authentication.
func (CommandExecFuncParamsHTTP) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTP) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllow ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth param.Field[CommandExecFuncParamsHTTPAllowAuth] `json:"auth"` // The hostname to allow. Host param.Field[string] `json:"host"` }
List of allowed HTTP hosts and associated authentication.
func (CommandExecFuncParamsHTTPAllow) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllow) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllowAuth ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllowAuth struct { Basic param.Field[CommandExecFuncParamsHTTPAllowAuthBasic] `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer param.Field[CommandExecFuncParamsHTTPAllowAuthBearer] `json:"bearer"` Header param.Field[CommandExecFuncParamsHTTPAllowAuthHeader] `json:"header"` Query param.Field[CommandExecFuncParamsHTTPAllowAuthQuery] `json:"query"` }
Authentication configuration for outbound requests to this host.
func (CommandExecFuncParamsHTTPAllowAuth) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllowAuth) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllowAuthBasic ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllowAuthBasic struct { Password param.Field[string] `json:"password"` UserID param.Field[string] `json:"user_id"` }
func (CommandExecFuncParamsHTTPAllowAuthBasic) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllowAuthBasic) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllowAuthBearer ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token param.Field[string] `json:"token"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (CommandExecFuncParamsHTTPAllowAuthBearer) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllowAuthBearer) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllowAuthHeader ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllowAuthHeader struct { Name param.Field[string] `json:"name"` Value param.Field[string] `json:"value"` }
func (CommandExecFuncParamsHTTPAllowAuthHeader) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllowAuthHeader) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsHTTPAllowAuthQuery ¶ added in v0.7.0
type CommandExecFuncParamsHTTPAllowAuthQuery struct { Key param.Field[string] `json:"key"` Value param.Field[string] `json:"value"` }
func (CommandExecFuncParamsHTTPAllowAuthQuery) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsHTTPAllowAuthQuery) MarshalJSON() (data []byte, err error)
type CommandExecFuncParamsLanguage ¶ added in v0.7.0
type CommandExecFuncParamsLanguage string
The interpreter to use when executing code.
const ( CommandExecFuncParamsLanguagePython CommandExecFuncParamsLanguage = "python" CommandExecFuncParamsLanguageJavascript CommandExecFuncParamsLanguage = "javascript" CommandExecFuncParamsLanguageTypescript CommandExecFuncParamsLanguage = "typescript" )
func (CommandExecFuncParamsLanguage) IsKnown ¶ added in v0.7.0
func (r CommandExecFuncParamsLanguage) IsKnown() bool
type CommandExecFuncParamsLimits ¶ added in v0.7.0
type CommandExecFuncParamsLimits struct { // The maximum time allowed for execution (in seconds). Default is 30. ExecutionTimeout param.Field[int64] `json:"execution_timeout"` // The maximum memory allowed for execution (in MiB). Default is 128. MemorySize param.Field[int64] `json:"memory_size"` }
Configuration for execution environment limits.
func (CommandExecFuncParamsLimits) MarshalJSON ¶ added in v0.7.0
func (r CommandExecFuncParamsLimits) MarshalJSON() (data []byte, err error)
type CommandExecFuncResponse ¶ added in v0.7.0
type CommandExecFuncResponse struct { // The execution details of the function. Execution CommandExecFuncResponseExecution `json:"execution,required"` // The output of the function. Output interface{} `json:"output,required"` // The status of the output. "valid" means your function executed successfully and // returned a valid JSON-serializable object, or void. "json_serialization_error" // means your function executed successfully, but returned a nonserializable // object. "error" means your function failed to execute. OutputStatus CommandExecFuncResponseOutputStatus `json:"output_status,required"` JSON commandExecFuncResponseJSON `json:"-"` }
func (*CommandExecFuncResponse) UnmarshalJSON ¶ added in v0.7.0
func (r *CommandExecFuncResponse) UnmarshalJSON(data []byte) (err error)
type CommandExecFuncResponseExecution ¶ added in v0.7.0
type CommandExecFuncResponseExecution struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the function in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the function. Will often be '0' on success and // non-zero on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the function. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the function. Stdout string `json:"stdout,required"` JSON commandExecFuncResponseExecutionJSON `json:"-"` }
The execution details of the function.
func (*CommandExecFuncResponseExecution) UnmarshalJSON ¶ added in v0.7.0
func (r *CommandExecFuncResponseExecution) UnmarshalJSON(data []byte) (err error)
type CommandExecFuncResponseOutputStatus ¶ added in v0.7.0
type CommandExecFuncResponseOutputStatus string
The status of the output. "valid" means your function executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your function executed successfully, but returned a nonserializable object. "error" means your function failed to execute.
const ( CommandExecFuncResponseOutputStatusError CommandExecFuncResponseOutputStatus = "error" CommandExecFuncResponseOutputStatusJsonSerializationError CommandExecFuncResponseOutputStatus = "json_serialization_error" CommandExecFuncResponseOutputStatusValid CommandExecFuncResponseOutputStatus = "valid" )
func (CommandExecFuncResponseOutputStatus) IsKnown ¶ added in v0.7.0
func (r CommandExecFuncResponseOutputStatus) IsKnown() bool
type CommandExecParams ¶
type CommandExecParams struct { // The code to execute. Code param.Field[string] `json:"code,required"` // The interpreter to use when executing code. Language param.Field[CommandExecParamsLanguage] `json:"language,required"` // List of command line arguments to pass to the script. Args param.Field[[]string] `json:"args"` // Set of key-value pairs to add to the script's execution environment. Env param.Field[map[string]string] `json:"env"` // List of input files. Files param.Field[[]CommandExecParamsFile] `json:"files"` // Configuration for HTTP requests and authentication. HTTP param.Field[CommandExecParamsHTTP] `json:"http"` // Configuration for execution environment limits. Limits param.Field[CommandExecParamsLimits] `json:"limits"` // The ID of the runtime revision to use when executing code. RuntimeRevisionID param.Field[string] `json:"runtime_revision_id"` // Input made available to the script via 'stdin'. Stdin param.Field[string] `json:"stdin"` }
func (CommandExecParams) MarshalJSON ¶
func (r CommandExecParams) MarshalJSON() (data []byte, err error)
type CommandExecParamsFile ¶
type CommandExecParamsFile struct { // The contents of the file. Contents param.Field[string] `json:"contents"` // The relative path of the file. Path param.Field[string] `json:"path"` }
func (CommandExecParamsFile) MarshalJSON ¶
func (r CommandExecParamsFile) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTP ¶
type CommandExecParamsHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow param.Field[[]CommandExecParamsHTTPAllow] `json:"allow"` }
Configuration for HTTP requests and authentication.
func (CommandExecParamsHTTP) MarshalJSON ¶
func (r CommandExecParamsHTTP) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllow ¶
type CommandExecParamsHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth param.Field[CommandExecParamsHTTPAllowAuth] `json:"auth"` // The hostname to allow. Host param.Field[string] `json:"host"` }
List of allowed HTTP hosts and associated authentication.
func (CommandExecParamsHTTPAllow) MarshalJSON ¶
func (r CommandExecParamsHTTPAllow) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllowAuth ¶
type CommandExecParamsHTTPAllowAuth struct { Basic param.Field[CommandExecParamsHTTPAllowAuthBasic] `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer param.Field[CommandExecParamsHTTPAllowAuthBearer] `json:"bearer"` Header param.Field[CommandExecParamsHTTPAllowAuthHeader] `json:"header"` Query param.Field[CommandExecParamsHTTPAllowAuthQuery] `json:"query"` }
Authentication configuration for outbound requests to this host.
func (CommandExecParamsHTTPAllowAuth) MarshalJSON ¶
func (r CommandExecParamsHTTPAllowAuth) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllowAuthBasic ¶
type CommandExecParamsHTTPAllowAuthBasic struct { Password param.Field[string] `json:"password"` UserID param.Field[string] `json:"user_id"` }
func (CommandExecParamsHTTPAllowAuthBasic) MarshalJSON ¶
func (r CommandExecParamsHTTPAllowAuthBasic) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllowAuthBearer ¶
type CommandExecParamsHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token param.Field[string] `json:"token"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (CommandExecParamsHTTPAllowAuthBearer) MarshalJSON ¶
func (r CommandExecParamsHTTPAllowAuthBearer) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllowAuthHeader ¶
type CommandExecParamsHTTPAllowAuthHeader struct { Name param.Field[string] `json:"name"` Value param.Field[string] `json:"value"` }
func (CommandExecParamsHTTPAllowAuthHeader) MarshalJSON ¶
func (r CommandExecParamsHTTPAllowAuthHeader) MarshalJSON() (data []byte, err error)
type CommandExecParamsHTTPAllowAuthQuery ¶
type CommandExecParamsHTTPAllowAuthQuery struct { Key param.Field[string] `json:"key"` Value param.Field[string] `json:"value"` }
func (CommandExecParamsHTTPAllowAuthQuery) MarshalJSON ¶
func (r CommandExecParamsHTTPAllowAuthQuery) MarshalJSON() (data []byte, err error)
type CommandExecParamsLanguage ¶
type CommandExecParamsLanguage string
The interpreter to use when executing code.
const ( CommandExecParamsLanguagePython CommandExecParamsLanguage = "python" CommandExecParamsLanguageJavascript CommandExecParamsLanguage = "javascript" CommandExecParamsLanguageTypescript CommandExecParamsLanguage = "typescript" CommandExecParamsLanguageRuby CommandExecParamsLanguage = "ruby" CommandExecParamsLanguagePhp CommandExecParamsLanguage = "php" )
func (CommandExecParamsLanguage) IsKnown ¶
func (r CommandExecParamsLanguage) IsKnown() bool
type CommandExecParamsLimits ¶
type CommandExecParamsLimits struct { // The maximum time allowed for execution (in seconds). Default is 30. ExecutionTimeout param.Field[int64] `json:"execution_timeout"` // The maximum memory allowed for execution (in MiB). Default is 128. MemorySize param.Field[int64] `json:"memory_size"` }
Configuration for execution environment limits.
func (CommandExecParamsLimits) MarshalJSON ¶
func (r CommandExecParamsLimits) MarshalJSON() (data []byte, err error)
type CommandExecResponse ¶
type CommandExecResponse struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the script in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the script. Will often be '0' on success and non-zero // on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the script. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the script. Stdout string `json:"stdout,required"` JSON commandExecResponseJSON `json:"-"` }
func (*CommandExecResponse) UnmarshalJSON ¶
func (r *CommandExecResponse) UnmarshalJSON(data []byte) (err error)
type CommandService ¶
type CommandService struct {
Options []option.RequestOption
}
CommandService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCommandService method instead.
func NewCommandService ¶
func NewCommandService(opts ...option.RequestOption) (r *CommandService)
NewCommandService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CommandService) Exec ¶
func (r *CommandService) Exec(ctx context.Context, body CommandExecParams, opts ...option.RequestOption) (res *CommandExecResponse, err error)
Run a script in a secure, isolated environment. Scripts can read from `stdin` and write to `stdout` or `stderr`. They can access input files, environment variables and command line arguments.
func (*CommandService) ExecFunc ¶ added in v0.7.0
func (r *CommandService) ExecFunc(ctx context.Context, body CommandExecFuncParams, opts ...option.RequestOption) (res *CommandExecFuncResponse, err error)
Run a function in a secure, isolated environment. Define a function named `execute`. The function will be passed `input` as an object.
type Execution ¶ added in v0.12.0
type Execution struct { ID string `json:"id,required"` Duration int64 `json:"duration,required"` ExitCode int64 `json:"exit_code,required"` Language ExecutionLanguage `json:"language,required"` StartedAt time.Time `json:"started_at,required" format:"date-time"` Details ExecutionDetails `json:"details"` JSON executionJSON `json:"-"` }
func (*Execution) UnmarshalJSON ¶ added in v0.12.0
type ExecutionDetails ¶ added in v0.12.0
type ExecutionDetails struct { // This field can have the runtime type of // [ExecutionDetailsToolExecutionDetailsRequest], // [ExecutionDetailsFunctionExecutionDetailsRequest], // [ExecutionDetailsScriptExecutionDetailsRequest]. Request interface{} `json:"request,required"` // This field can have the runtime type of // [ExecutionDetailsToolExecutionDetailsResponse], // [ExecutionDetailsFunctionExecutionDetailsResponse], // [ExecutionDetailsScriptExecutionDetailsResponse]. Response interface{} `json:"response,required"` Type ExecutionDetailsType `json:"type,required"` ToolID string `json:"tool_id"` JSON executionDetailsJSON `json:"-"` // contains filtered or unexported fields }
func (ExecutionDetails) AsUnion ¶ added in v0.12.0
func (r ExecutionDetails) AsUnion() ExecutionDetailsUnion
AsUnion returns a ExecutionDetailsUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are ExecutionDetailsToolExecutionDetails, ExecutionDetailsFunctionExecutionDetails, ExecutionDetailsScriptExecutionDetails.
func (*ExecutionDetails) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetails) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetails ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetails struct { Request ExecutionDetailsFunctionExecutionDetailsRequest `json:"request,required"` Response ExecutionDetailsFunctionExecutionDetailsResponse `json:"response,required"` Type ExecutionDetailsFunctionExecutionDetailsType `json:"type,required"` JSON executionDetailsFunctionExecutionDetailsJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetails) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetails) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequest ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequest struct { // The function to execute. Your code must define a function named "execute" that // takes in a single argument and returns a JSON-serializable value. Code string `json:"code,required"` // The interpreter to use when executing code. Language ExecutionDetailsFunctionExecutionDetailsRequestLanguage `json:"language,required"` // Set of key-value pairs to add to the function's execution environment. Env map[string]string `json:"env"` // List of input files. Files []ExecutionDetailsFunctionExecutionDetailsRequestFile `json:"files"` // Configuration for HTTP requests and authentication. HTTP ExecutionDetailsFunctionExecutionDetailsRequestHTTP `json:"http"` // The input to the function. This must be a valid JSON-serializable object. If you // do not pass an input, your function will be called with None (Python) or null // (JavaScript/TypeScript) as the argument. Input interface{} `json:"input"` // Configuration for execution environment limits. Limits ExecutionDetailsFunctionExecutionDetailsRequestLimits `json:"limits"` // The ID of the runtime revision to use when executing code. RuntimeRevisionID string `json:"runtime_revision_id"` JSON executionDetailsFunctionExecutionDetailsRequestJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsRequest) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequest) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestFile ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestFile struct { // The contents of the file. Contents string `json:"contents"` // The relative path of the file. Path string `json:"path"` JSON executionDetailsFunctionExecutionDetailsRequestFileJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsRequestFile) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestFile) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTP ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow []ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow `json:"allow"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPJSON `json:"-"` }
Configuration for HTTP requests and authentication.
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTP) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTP) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth `json:"auth"` // The hostname to allow. Host string `json:"host"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowJSON `json:"-"` }
List of allowed HTTP hosts and associated authentication.
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllow) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth struct { Basic ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer `json:"bearer"` Header ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader `json:"header"` Query ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery `json:"query"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthJSON `json:"-"` }
Authentication configuration for outbound requests to this host.
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic struct { Password string `json:"password"` UserID string `json:"user_id"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasicJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token string `json:"token"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearerJSON `json:"-"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader struct { Name string `json:"name"` Value string `json:"value"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeaderJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthHeader) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery struct { Key string `json:"key"` Value string `json:"value"` JSON executionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQueryJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsRequestLanguage ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestLanguage string
The interpreter to use when executing code.
const ( ExecutionDetailsFunctionExecutionDetailsRequestLanguagePython ExecutionDetailsFunctionExecutionDetailsRequestLanguage = "python" ExecutionDetailsFunctionExecutionDetailsRequestLanguageJavascript ExecutionDetailsFunctionExecutionDetailsRequestLanguage = "javascript" ExecutionDetailsFunctionExecutionDetailsRequestLanguageTypescript ExecutionDetailsFunctionExecutionDetailsRequestLanguage = "typescript" )
func (ExecutionDetailsFunctionExecutionDetailsRequestLanguage) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsFunctionExecutionDetailsRequestLanguage) IsKnown() bool
type ExecutionDetailsFunctionExecutionDetailsRequestLimits ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsRequestLimits struct { // The maximum time allowed for execution (in seconds). Default is 30. ExecutionTimeout int64 `json:"execution_timeout"` // The maximum memory allowed for execution (in MiB). Default is 128. MemorySize int64 `json:"memory_size"` JSON executionDetailsFunctionExecutionDetailsRequestLimitsJSON `json:"-"` }
Configuration for execution environment limits.
func (*ExecutionDetailsFunctionExecutionDetailsRequestLimits) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsRequestLimits) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsResponse ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsResponse struct { // The execution details of the function. Execution ExecutionDetailsFunctionExecutionDetailsResponseExecution `json:"execution,required"` // The output of the function. Output interface{} `json:"output,required"` // The status of the output. "valid" means your function executed successfully and // returned a valid JSON-serializable object, or void. "json_serialization_error" // means your function executed successfully, but returned a nonserializable // object. "error" means your function failed to execute. OutputStatus ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus `json:"output_status,required"` JSON executionDetailsFunctionExecutionDetailsResponseJSON `json:"-"` }
func (*ExecutionDetailsFunctionExecutionDetailsResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsResponse) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsResponseExecution ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsResponseExecution struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the function in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the function. Will often be '0' on success and // non-zero on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the function. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the function. Stdout string `json:"stdout,required"` JSON executionDetailsFunctionExecutionDetailsResponseExecutionJSON `json:"-"` }
The execution details of the function.
func (*ExecutionDetailsFunctionExecutionDetailsResponseExecution) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsFunctionExecutionDetailsResponseExecution) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus string
The status of the output. "valid" means your function executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your function executed successfully, but returned a nonserializable object. "error" means your function failed to execute.
const ( ExecutionDetailsFunctionExecutionDetailsResponseOutputStatusError ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus = "error" ExecutionDetailsFunctionExecutionDetailsResponseOutputStatusJsonSerializationError ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus = "json_serialization_error" ExecutionDetailsFunctionExecutionDetailsResponseOutputStatusValid ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus = "valid" )
func (ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsFunctionExecutionDetailsResponseOutputStatus) IsKnown() bool
type ExecutionDetailsFunctionExecutionDetailsType ¶ added in v0.12.0
type ExecutionDetailsFunctionExecutionDetailsType string
const (
ExecutionDetailsFunctionExecutionDetailsTypeFunction ExecutionDetailsFunctionExecutionDetailsType = "function"
)
func (ExecutionDetailsFunctionExecutionDetailsType) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsFunctionExecutionDetailsType) IsKnown() bool
type ExecutionDetailsScriptExecutionDetails ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetails struct { Request ExecutionDetailsScriptExecutionDetailsRequest `json:"request,required"` Response ExecutionDetailsScriptExecutionDetailsResponse `json:"response,required"` Type ExecutionDetailsScriptExecutionDetailsType `json:"type,required"` JSON executionDetailsScriptExecutionDetailsJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetails) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetails) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequest ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequest struct { // The code to execute. Code string `json:"code,required"` // The interpreter to use when executing code. Language ExecutionDetailsScriptExecutionDetailsRequestLanguage `json:"language,required"` // List of command line arguments to pass to the script. Args []string `json:"args"` // Set of key-value pairs to add to the script's execution environment. Env map[string]string `json:"env"` // List of input files. Files []ExecutionDetailsScriptExecutionDetailsRequestFile `json:"files"` // Configuration for HTTP requests and authentication. HTTP ExecutionDetailsScriptExecutionDetailsRequestHTTP `json:"http"` // Configuration for execution environment limits. Limits ExecutionDetailsScriptExecutionDetailsRequestLimits `json:"limits"` // The ID of the runtime revision to use when executing code. RuntimeRevisionID string `json:"runtime_revision_id"` // Input made available to the script via 'stdin'. Stdin string `json:"stdin"` JSON executionDetailsScriptExecutionDetailsRequestJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsRequest) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequest) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestFile ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestFile struct { // The contents of the file. Contents string `json:"contents"` // The relative path of the file. Path string `json:"path"` JSON executionDetailsScriptExecutionDetailsRequestFileJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsRequestFile) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestFile) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTP ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow []ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow `json:"allow"` JSON executionDetailsScriptExecutionDetailsRequestHTTPJSON `json:"-"` }
Configuration for HTTP requests and authentication.
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTP) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTP) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth `json:"auth"` // The hostname to allow. Host string `json:"host"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowJSON `json:"-"` }
List of allowed HTTP hosts and associated authentication.
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllow) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth struct { Basic ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer `json:"bearer"` Header ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader `json:"header"` Query ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery `json:"query"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowAuthJSON `json:"-"` }
Authentication configuration for outbound requests to this host.
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic struct { Password string `json:"password"` UserID string `json:"user_id"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasicJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token string `json:"token"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearerJSON `json:"-"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader struct { Name string `json:"name"` Value string `json:"value"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeaderJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthHeader) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery struct { Key string `json:"key"` Value string `json:"value"` JSON executionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQueryJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsRequestLanguage ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestLanguage string
The interpreter to use when executing code.
const ( ExecutionDetailsScriptExecutionDetailsRequestLanguagePython ExecutionDetailsScriptExecutionDetailsRequestLanguage = "python" ExecutionDetailsScriptExecutionDetailsRequestLanguageJavascript ExecutionDetailsScriptExecutionDetailsRequestLanguage = "javascript" ExecutionDetailsScriptExecutionDetailsRequestLanguageTypescript ExecutionDetailsScriptExecutionDetailsRequestLanguage = "typescript" ExecutionDetailsScriptExecutionDetailsRequestLanguageRuby ExecutionDetailsScriptExecutionDetailsRequestLanguage = "ruby" ExecutionDetailsScriptExecutionDetailsRequestLanguagePhp ExecutionDetailsScriptExecutionDetailsRequestLanguage = "php" )
func (ExecutionDetailsScriptExecutionDetailsRequestLanguage) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsScriptExecutionDetailsRequestLanguage) IsKnown() bool
type ExecutionDetailsScriptExecutionDetailsRequestLimits ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsRequestLimits struct { // The maximum time allowed for execution (in seconds). Default is 30. ExecutionTimeout int64 `json:"execution_timeout"` // The maximum memory allowed for execution (in MiB). Default is 128. MemorySize int64 `json:"memory_size"` JSON executionDetailsScriptExecutionDetailsRequestLimitsJSON `json:"-"` }
Configuration for execution environment limits.
func (*ExecutionDetailsScriptExecutionDetailsRequestLimits) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsRequestLimits) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsResponse ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsResponse struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the script in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the script. Will often be '0' on success and non-zero // on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the script. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the script. Stdout string `json:"stdout,required"` JSON executionDetailsScriptExecutionDetailsResponseJSON `json:"-"` }
func (*ExecutionDetailsScriptExecutionDetailsResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsScriptExecutionDetailsResponse) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsScriptExecutionDetailsType ¶ added in v0.12.0
type ExecutionDetailsScriptExecutionDetailsType string
const (
ExecutionDetailsScriptExecutionDetailsTypeScript ExecutionDetailsScriptExecutionDetailsType = "script"
)
func (ExecutionDetailsScriptExecutionDetailsType) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsScriptExecutionDetailsType) IsKnown() bool
type ExecutionDetailsToolExecutionDetails ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetails struct { Request ExecutionDetailsToolExecutionDetailsRequest `json:"request,required"` Response ExecutionDetailsToolExecutionDetailsResponse `json:"response,required"` ToolID string `json:"tool_id,required"` Type ExecutionDetailsToolExecutionDetailsType `json:"type,required"` JSON executionDetailsToolExecutionDetailsJSON `json:"-"` }
func (*ExecutionDetailsToolExecutionDetails) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetails) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequest ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequest struct { // Set of key-value pairs to add to the tool's execution environment. Env []ExecutionDetailsToolExecutionDetailsRequestEnv `json:"env"` // Configuration for HTTP requests and authentication. HTTP ExecutionDetailsToolExecutionDetailsRequestHTTP `json:"http"` // The input to the tool. This must be a valid JSON-serializable object. It will be // validated against the tool's input schema. Input interface{} `json:"input"` // The Tool revision ID to execute. This optional parmeter is used to pin // executions to specific versions of the Tool. If not provided, the latest // (current) version of the Tool will be executed. RevisionID string `json:"revision_id"` JSON executionDetailsToolExecutionDetailsRequestJSON `json:"-"` }
func (*ExecutionDetailsToolExecutionDetailsRequest) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequest) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestEnv ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestEnv struct { Name string `json:"name,required"` SecretID string `json:"secret_id"` Value string `json:"value"` JSON executionDetailsToolExecutionDetailsRequestEnvJSON `json:"-"` }
Set of key-value pairs to add to the tool's execution environment.
func (*ExecutionDetailsToolExecutionDetailsRequestEnv) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestEnv) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTP ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow []ExecutionDetailsToolExecutionDetailsRequestHTTPAllow `json:"allow"` JSON executionDetailsToolExecutionDetailsRequestHTTPJSON `json:"-"` }
Configuration for HTTP requests and authentication.
func (*ExecutionDetailsToolExecutionDetailsRequestHTTP) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTP) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllow ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth `json:"auth"` // The hostname to allow. Host string `json:"host"` JSON executionDetailsToolExecutionDetailsRequestHTTPAllowJSON `json:"-"` }
List of allowed HTTP hosts and associated authentication.
func (*ExecutionDetailsToolExecutionDetailsRequestHTTPAllow) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTPAllow) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth struct { Basic ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer `json:"bearer"` Query ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery `json:"query"` JSON executionDetailsToolExecutionDetailsRequestHTTPAllowAuthJSON `json:"-"` }
Authentication configuration for outbound requests to this host.
func (*ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuth) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic struct { Password string `json:"password"` SecretID string `json:"secret_id"` UserID string `json:"user_id"` JSON executionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasicJSON `json:"-"` }
func (*ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBasic) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token string `json:"token"` SecretID string `json:"secret_id"` JSON executionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearerJSON `json:"-"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (*ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthBearer) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery struct { Key string `json:"key"` SecretID string `json:"secret_id"` Value string `json:"value"` JSON executionDetailsToolExecutionDetailsRequestHTTPAllowAuthQueryJSON `json:"-"` }
func (*ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsRequestHTTPAllowAuthQuery) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsResponse ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsResponse struct { // The execution details of the function. Execution ExecutionDetailsToolExecutionDetailsResponseExecution `json:"execution,required"` // The returned value of the Tool's execute function. Output interface{} `json:"output,required"` // The status of the output. "valid" means your Tool executed successfully and // returned a valid JSON-serializable object, or void. "json_serialization_error" // means your Tool executed successfully, but returned a nonserializable object. // "error" means your Tool failed to execute. OutputStatus ExecutionDetailsToolExecutionDetailsResponseOutputStatus `json:"output_status,required"` JSON executionDetailsToolExecutionDetailsResponseJSON `json:"-"` }
func (*ExecutionDetailsToolExecutionDetailsResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsResponse) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsResponseExecution ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsResponseExecution struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the function in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the function. Will often be '0' on success and // non-zero on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the function. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the function. Stdout string `json:"stdout,required"` JSON executionDetailsToolExecutionDetailsResponseExecutionJSON `json:"-"` }
The execution details of the function.
func (*ExecutionDetailsToolExecutionDetailsResponseExecution) UnmarshalJSON ¶ added in v0.12.0
func (r *ExecutionDetailsToolExecutionDetailsResponseExecution) UnmarshalJSON(data []byte) (err error)
type ExecutionDetailsToolExecutionDetailsResponseOutputStatus ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsResponseOutputStatus string
The status of the output. "valid" means your Tool executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your Tool executed successfully, but returned a nonserializable object. "error" means your Tool failed to execute.
const ( ExecutionDetailsToolExecutionDetailsResponseOutputStatusError ExecutionDetailsToolExecutionDetailsResponseOutputStatus = "error" ExecutionDetailsToolExecutionDetailsResponseOutputStatusJsonSerializationError ExecutionDetailsToolExecutionDetailsResponseOutputStatus = "json_serialization_error" ExecutionDetailsToolExecutionDetailsResponseOutputStatusValid ExecutionDetailsToolExecutionDetailsResponseOutputStatus = "valid" )
func (ExecutionDetailsToolExecutionDetailsResponseOutputStatus) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsToolExecutionDetailsResponseOutputStatus) IsKnown() bool
type ExecutionDetailsToolExecutionDetailsType ¶ added in v0.12.0
type ExecutionDetailsToolExecutionDetailsType string
const (
ExecutionDetailsToolExecutionDetailsTypeTool ExecutionDetailsToolExecutionDetailsType = "tool"
)
func (ExecutionDetailsToolExecutionDetailsType) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsToolExecutionDetailsType) IsKnown() bool
type ExecutionDetailsType ¶ added in v0.12.0
type ExecutionDetailsType string
const ( ExecutionDetailsTypeTool ExecutionDetailsType = "tool" ExecutionDetailsTypeFunction ExecutionDetailsType = "function" ExecutionDetailsTypeScript ExecutionDetailsType = "script" )
func (ExecutionDetailsType) IsKnown ¶ added in v0.12.0
func (r ExecutionDetailsType) IsKnown() bool
type ExecutionDetailsUnion ¶ added in v0.12.0
type ExecutionDetailsUnion interface {
// contains filtered or unexported methods
}
Union satisfied by ExecutionDetailsToolExecutionDetails, ExecutionDetailsFunctionExecutionDetails or ExecutionDetailsScriptExecutionDetails.
type ExecutionLanguage ¶ added in v0.12.0
type ExecutionLanguage string
const ( ExecutionLanguagePython ExecutionLanguage = "python" ExecutionLanguageJavascript ExecutionLanguage = "javascript" ExecutionLanguageTypescript ExecutionLanguage = "typescript" ExecutionLanguageRuby ExecutionLanguage = "ruby" ExecutionLanguagePhp ExecutionLanguage = "php" )
func (ExecutionLanguage) IsKnown ¶ added in v0.12.0
func (r ExecutionLanguage) IsKnown() bool
type ExecutionListParams ¶ added in v0.12.0
type ExecutionListParams struct { // The number of items to return. Defaults to 100. Maximum is 100. Limit param.Field[int64] `query:"limit"` // If true, only show executions where the exit code is not 0, indicating an // execution error. Defaults to false. OnlyNonZeroExitCodes param.Field[bool] `query:"only_non_zero_exit_codes"` // The ID of the item to start after. To get the next page of results, set this to // the ID of the last item in the current page. StartingAfter param.Field[string] `query:"starting_after"` }
func (ExecutionListParams) URLQuery ¶ added in v0.12.0
func (r ExecutionListParams) URLQuery() (v url.Values)
URLQuery serializes ExecutionListParams's query parameters as `url.Values`.
type ExecutionService ¶ added in v0.12.0
type ExecutionService struct {
Options []option.RequestOption
}
ExecutionService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewExecutionService method instead.
func NewExecutionService ¶ added in v0.12.0
func NewExecutionService(opts ...option.RequestOption) (r *ExecutionService)
NewExecutionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ExecutionService) Get ¶ added in v0.12.0
func (r *ExecutionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Execution, err error)
Retrieves an execution.
func (*ExecutionService) List ¶ added in v0.12.0
func (r *ExecutionService) List(ctx context.Context, query ExecutionListParams, opts ...option.RequestOption) (res *pagination.DefaultPagination[Execution], err error)
Returns a list of executions in your project.
func (*ExecutionService) ListAutoPaging ¶ added in v0.12.0
func (r *ExecutionService) ListAutoPaging(ctx context.Context, query ExecutionListParams, opts ...option.RequestOption) *pagination.DefaultPaginationAutoPager[Execution]
Returns a list of executions in your project.
type Revision ¶ added in v0.4.0
type Revision struct { ID string `json:"id,required"` ManifestFile RevisionManifestFile `json:"manifest_file,required"` RuntimeID string `json:"runtime_id,required"` Status RevisionStatus `json:"status,required"` AdditionalPythonImports string `json:"additional_python_imports"` JSON revisionJSON `json:"-"` }
func (*Revision) UnmarshalJSON ¶ added in v0.4.0
type RevisionManifestFile ¶ added in v0.4.0
type RevisionManifestFile struct { Contents string `json:"contents,required"` Name RevisionManifestFileName `json:"name,required"` JSON revisionManifestFileJSON `json:"-"` }
func (*RevisionManifestFile) UnmarshalJSON ¶ added in v0.4.0
func (r *RevisionManifestFile) UnmarshalJSON(data []byte) (err error)
type RevisionManifestFileName ¶ added in v0.4.0
type RevisionManifestFileName string
const ( RevisionManifestFileNameRequirementsTxt RevisionManifestFileName = "requirements.txt" RevisionManifestFileNamePackageJson RevisionManifestFileName = "package.json" )
func (RevisionManifestFileName) IsKnown ¶ added in v0.4.0
func (r RevisionManifestFileName) IsKnown() bool
type RevisionStatus ¶ added in v0.4.0
type RevisionStatus string
const ( RevisionStatusPending RevisionStatus = "pending" RevisionStatusBuilding RevisionStatus = "building" RevisionStatusSucceeded RevisionStatus = "succeeded" RevisionStatusFailed RevisionStatus = "failed" RevisionStatusCancelled RevisionStatus = "cancelled" )
func (RevisionStatus) IsKnown ¶ added in v0.4.0
func (r RevisionStatus) IsKnown() bool
type Runtime ¶ added in v0.4.0
type Runtime struct { ID string `json:"id,required"` Engine RuntimeEngine `json:"engine,required"` Language RuntimeLanguage `json:"language,required"` Name string `json:"name,required"` RevisionID string `json:"revision_id,required"` Status RuntimeStatus `json:"status,required"` AdditionalPythonImports string `json:"additional_python_imports"` ManifestFile RuntimeManifestFile `json:"manifest_file"` JSON runtimeJSON `json:"-"` }
func (*Runtime) UnmarshalJSON ¶ added in v0.4.0
type RuntimeDeleteResponse ¶ added in v0.12.0
type RuntimeDeleteResponse struct { ID string `json:"id"` Deleted bool `json:"deleted"` JSON runtimeDeleteResponseJSON `json:"-"` }
func (*RuntimeDeleteResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *RuntimeDeleteResponse) UnmarshalJSON(data []byte) (err error)
type RuntimeEngine ¶ added in v0.11.0
type RuntimeEngine string
const ( RuntimeEngineWasi RuntimeEngine = "wasi" RuntimeEngineMicrovm RuntimeEngine = "microvm" RuntimeEngineV8 RuntimeEngine = "v8" )
func (RuntimeEngine) IsKnown ¶ added in v0.11.0
func (r RuntimeEngine) IsKnown() bool
type RuntimeLanguage ¶ added in v0.4.0
type RuntimeLanguage string
const ( RuntimeLanguagePython RuntimeLanguage = "python" RuntimeLanguageJavascript RuntimeLanguage = "javascript" )
func (RuntimeLanguage) IsKnown ¶ added in v0.4.0
func (r RuntimeLanguage) IsKnown() bool
type RuntimeListParams ¶ added in v0.11.0
type RuntimeListParams struct { // The number of items to return. Defaults to 100. Maximum is 100. Limit param.Field[int64] `query:"limit"` // The ID of the item to start after. To get the next page of results, set this to // the ID of the last item in the current page. StartingAfter param.Field[string] `query:"starting_after"` }
func (RuntimeListParams) URLQuery ¶ added in v0.11.0
func (r RuntimeListParams) URLQuery() (v url.Values)
URLQuery serializes RuntimeListParams's query parameters as `url.Values`.
type RuntimeManifestFile ¶ added in v0.4.0
type RuntimeManifestFile struct { Contents string `json:"contents,required"` Name RuntimeManifestFileName `json:"name,required"` JSON runtimeManifestFileJSON `json:"-"` }
func (*RuntimeManifestFile) UnmarshalJSON ¶ added in v0.4.0
func (r *RuntimeManifestFile) UnmarshalJSON(data []byte) (err error)
type RuntimeManifestFileName ¶ added in v0.4.0
type RuntimeManifestFileName string
const ( RuntimeManifestFileNameRequirementsTxt RuntimeManifestFileName = "requirements.txt" RuntimeManifestFileNamePackageJson RuntimeManifestFileName = "package.json" )
func (RuntimeManifestFileName) IsKnown ¶ added in v0.4.0
func (r RuntimeManifestFileName) IsKnown() bool
type RuntimeNewParams ¶ added in v0.4.0
type RuntimeNewParams struct { Language param.Field[RuntimeNewParamsLanguage] `json:"language,required"` ManifestFile param.Field[RuntimeNewParamsManifestFile] `json:"manifest_file,required"` Name param.Field[string] `json:"name,required"` AdditionalPythonImports param.Field[string] `json:"additional_python_imports"` Engine param.Field[RuntimeNewParamsEngine] `json:"engine"` }
func (RuntimeNewParams) MarshalJSON ¶ added in v0.4.0
func (r RuntimeNewParams) MarshalJSON() (data []byte, err error)
type RuntimeNewParamsEngine ¶ added in v0.11.0
type RuntimeNewParamsEngine string
const ( RuntimeNewParamsEngineWasi RuntimeNewParamsEngine = "wasi" RuntimeNewParamsEngineMicrovm RuntimeNewParamsEngine = "microvm" RuntimeNewParamsEngineV8 RuntimeNewParamsEngine = "v8" )
func (RuntimeNewParamsEngine) IsKnown ¶ added in v0.11.0
func (r RuntimeNewParamsEngine) IsKnown() bool
type RuntimeNewParamsLanguage ¶ added in v0.4.0
type RuntimeNewParamsLanguage string
const ( RuntimeNewParamsLanguagePython RuntimeNewParamsLanguage = "python" RuntimeNewParamsLanguageJavascript RuntimeNewParamsLanguage = "javascript" )
func (RuntimeNewParamsLanguage) IsKnown ¶ added in v0.4.0
func (r RuntimeNewParamsLanguage) IsKnown() bool
type RuntimeNewParamsManifestFile ¶ added in v0.4.0
type RuntimeNewParamsManifestFile struct { Contents param.Field[string] `json:"contents,required"` Name param.Field[RuntimeNewParamsManifestFileName] `json:"name,required"` }
func (RuntimeNewParamsManifestFile) MarshalJSON ¶ added in v0.4.0
func (r RuntimeNewParamsManifestFile) MarshalJSON() (data []byte, err error)
type RuntimeNewParamsManifestFileName ¶ added in v0.4.0
type RuntimeNewParamsManifestFileName string
const ( RuntimeNewParamsManifestFileNameRequirementsTxt RuntimeNewParamsManifestFileName = "requirements.txt" RuntimeNewParamsManifestFileNamePackageJson RuntimeNewParamsManifestFileName = "package.json" )
func (RuntimeNewParamsManifestFileName) IsKnown ¶ added in v0.4.0
func (r RuntimeNewParamsManifestFileName) IsKnown() bool
type RuntimeRevisionListResponse ¶ added in v0.4.0
type RuntimeRevisionListResponse struct { Revisions []Revision `json:"revisions,required"` JSON runtimeRevisionListResponseJSON `json:"-"` }
func (*RuntimeRevisionListResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *RuntimeRevisionListResponse) UnmarshalJSON(data []byte) (err error)
type RuntimeRevisionNewParams ¶ added in v0.4.0
type RuntimeRevisionNewParams struct { ManifestFile param.Field[RuntimeRevisionNewParamsManifestFile] `json:"manifest_file,required"` AdditionalPythonImports param.Field[string] `json:"additional_python_imports"` }
func (RuntimeRevisionNewParams) MarshalJSON ¶ added in v0.4.0
func (r RuntimeRevisionNewParams) MarshalJSON() (data []byte, err error)
type RuntimeRevisionNewParamsManifestFile ¶ added in v0.4.0
type RuntimeRevisionNewParamsManifestFile struct { Contents param.Field[string] `json:"contents,required"` Name param.Field[RuntimeRevisionNewParamsManifestFileName] `json:"name,required"` }
func (RuntimeRevisionNewParamsManifestFile) MarshalJSON ¶ added in v0.4.0
func (r RuntimeRevisionNewParamsManifestFile) MarshalJSON() (data []byte, err error)
type RuntimeRevisionNewParamsManifestFileName ¶ added in v0.4.0
type RuntimeRevisionNewParamsManifestFileName string
const ( RuntimeRevisionNewParamsManifestFileNameRequirementsTxt RuntimeRevisionNewParamsManifestFileName = "requirements.txt" RuntimeRevisionNewParamsManifestFileNamePackageJson RuntimeRevisionNewParamsManifestFileName = "package.json" )
func (RuntimeRevisionNewParamsManifestFileName) IsKnown ¶ added in v0.4.0
func (r RuntimeRevisionNewParamsManifestFileName) IsKnown() bool
type RuntimeRevisionService ¶ added in v0.4.0
type RuntimeRevisionService struct {
Options []option.RequestOption
}
RuntimeRevisionService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRuntimeRevisionService method instead.
func NewRuntimeRevisionService ¶ added in v0.4.0
func NewRuntimeRevisionService(opts ...option.RequestOption) (r *RuntimeRevisionService)
NewRuntimeRevisionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RuntimeRevisionService) Get ¶ added in v0.4.0
func (r *RuntimeRevisionService) Get(ctx context.Context, runtimeID string, revisionID string, opts ...option.RequestOption) (res *Revision, err error)
Retrieves a runtime revision.
func (*RuntimeRevisionService) List ¶ added in v0.4.0
func (r *RuntimeRevisionService) List(ctx context.Context, id string, opts ...option.RequestOption) (res *RuntimeRevisionListResponse, err error)
Lists all revisions for a runtime.
func (*RuntimeRevisionService) New ¶ added in v0.4.0
func (r *RuntimeRevisionService) New(ctx context.Context, id string, body RuntimeRevisionNewParams, opts ...option.RequestOption) (res *Revision, err error)
Creates a new runtime revision.
type RuntimeService ¶ added in v0.4.0
type RuntimeService struct { Options []option.RequestOption Revisions *RuntimeRevisionService }
RuntimeService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRuntimeService method instead.
func NewRuntimeService ¶ added in v0.4.0
func NewRuntimeService(opts ...option.RequestOption) (r *RuntimeService)
NewRuntimeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RuntimeService) Delete ¶ added in v0.12.0
func (r *RuntimeService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *RuntimeDeleteResponse, err error)
Deletes a runtime.
func (*RuntimeService) Get ¶ added in v0.4.0
func (r *RuntimeService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Runtime, err error)
Retrieves a runtime.
func (*RuntimeService) List ¶ added in v0.4.0
func (r *RuntimeService) List(ctx context.Context, query RuntimeListParams, opts ...option.RequestOption) (res *pagination.RuntimesPagination[Runtime], err error)
Returns a list of runtimes in your project.
func (*RuntimeService) ListAutoPaging ¶ added in v0.11.0
func (r *RuntimeService) ListAutoPaging(ctx context.Context, query RuntimeListParams, opts ...option.RequestOption) *pagination.RuntimesPaginationAutoPager[Runtime]
Returns a list of runtimes in your project.
func (*RuntimeService) New ¶ added in v0.4.0
func (r *RuntimeService) New(ctx context.Context, body RuntimeNewParams, opts ...option.RequestOption) (res *Runtime, err error)
Creates a runtime.
type RuntimeStatus ¶ added in v0.10.0
type RuntimeStatus string
const ( RuntimeStatusPending RuntimeStatus = "pending" RuntimeStatusBuilding RuntimeStatus = "building" RuntimeStatusSucceeded RuntimeStatus = "succeeded" RuntimeStatusFailed RuntimeStatus = "failed" RuntimeStatusCancelled RuntimeStatus = "cancelled" )
func (RuntimeStatus) IsKnown ¶ added in v0.10.0
func (r RuntimeStatus) IsKnown() bool
type Secret ¶
type Secret struct { ID string `json:"id,required"` Name string `json:"name,required"` JSON secretJSON `json:"-"` }
func (*Secret) UnmarshalJSON ¶
type SecretListParams ¶ added in v0.11.0
type SecretListParams struct { // The number of items to return. Defaults to 100. Maximum is 100. Limit param.Field[int64] `query:"limit"` // The ID of the item to start after. To get the next page of results, set this to // the ID of the last item in the current page. StartingAfter param.Field[string] `query:"starting_after"` }
func (SecretListParams) URLQuery ¶ added in v0.11.0
func (r SecretListParams) URLQuery() (v url.Values)
URLQuery serializes SecretListParams's query parameters as `url.Values`.
type SecretNewParams ¶ added in v0.2.0
type SecretNewParams struct { Name param.Field[string] `json:"name,required"` Value param.Field[string] `json:"value,required"` }
func (SecretNewParams) MarshalJSON ¶ added in v0.2.0
func (r SecretNewParams) MarshalJSON() (data []byte, err error)
type SecretService ¶
type SecretService struct {
Options []option.RequestOption
}
SecretService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSecretService method instead.
func NewSecretService ¶
func NewSecretService(opts ...option.RequestOption) (r *SecretService)
NewSecretService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SecretService) List ¶
func (r *SecretService) List(ctx context.Context, query SecretListParams, opts ...option.RequestOption) (res *pagination.SecretsPagination[Secret], err error)
Returns a list of secrets in your project.
func (*SecretService) ListAutoPaging ¶ added in v0.11.0
func (r *SecretService) ListAutoPaging(ctx context.Context, query SecretListParams, opts ...option.RequestOption) *pagination.SecretsPaginationAutoPager[Secret]
Returns a list of secrets in your project.
func (*SecretService) New ¶ added in v0.2.0
func (r *SecretService) New(ctx context.Context, body SecretNewParams, opts ...option.RequestOption) (res *Secret, err error)
Create a secret in your project.
type Tool ¶
type Tool struct { // The ID of the tool. ID string `json:"id,required"` // The code of the tool. You must define a function named "execute" that takes in a // single argument and returns a JSON-serializable value. The argument will be the // "input" passed when executing the tool, and will match the input schema. Code string `json:"code,required"` // A description of the tool. Description string `json:"description,required"` // The input schema of the tool. This must be a valid JSON Schema object. InputSchema interface{} `json:"input_schema,required"` // The language of the tool's code. Language ToolLanguage `json:"language,required"` // The name of the tool. Name string `json:"name,required"` // The ID of the tool's current revision. This is used to pin executions to a // specific version of the tool, even if the tool is updated later. RevisionID string `json:"revision_id,required"` // The ID of the custom runtime revision that the tool uses for executions. This // pins executions to specific version of a custom runtime runtime, even if the // runtime is updated later. RuntimeRevisionID string `json:"runtime_revision_id"` JSON toolJSON `json:"-"` }
func (*Tool) UnmarshalJSON ¶
type ToolExecParams ¶
type ToolExecParams struct { // Set of key-value pairs to add to the tool's execution environment. Env param.Field[[]ToolExecParamsEnv] `json:"env"` // Configuration for HTTP requests and authentication. HTTP param.Field[ToolExecParamsHTTP] `json:"http"` // The input to the tool. This must be a valid JSON-serializable object. It will be // validated against the tool's input schema. Input param.Field[interface{}] `json:"input"` // The Tool revision ID to execute. This optional parmeter is used to pin // executions to specific versions of the Tool. If not provided, the latest // (current) version of the Tool will be executed. RevisionID param.Field[string] `json:"revision_id"` }
func (ToolExecParams) MarshalJSON ¶
func (r ToolExecParams) MarshalJSON() (data []byte, err error)
type ToolExecParamsEnv ¶
type ToolExecParamsEnv struct { Name param.Field[string] `json:"name,required"` SecretID param.Field[string] `json:"secret_id"` Value param.Field[string] `json:"value"` }
Set of key-value pairs to add to the tool's execution environment.
func (ToolExecParamsEnv) MarshalJSON ¶
func (r ToolExecParamsEnv) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTP ¶
type ToolExecParamsHTTP struct { // List of allowed HTTP hosts and associated authentication. Allow param.Field[[]ToolExecParamsHTTPAllow] `json:"allow"` }
Configuration for HTTP requests and authentication.
func (ToolExecParamsHTTP) MarshalJSON ¶
func (r ToolExecParamsHTTP) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTPAllow ¶
type ToolExecParamsHTTPAllow struct { // Authentication configuration for outbound requests to this host. Auth param.Field[ToolExecParamsHTTPAllowAuth] `json:"auth"` // The hostname to allow. Host param.Field[string] `json:"host"` }
List of allowed HTTP hosts and associated authentication.
func (ToolExecParamsHTTPAllow) MarshalJSON ¶
func (r ToolExecParamsHTTPAllow) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTPAllowAuth ¶
type ToolExecParamsHTTPAllowAuth struct { Basic param.Field[ToolExecParamsHTTPAllowAuthBasic] `json:"basic"` // Configuration to add an 'Authorization' header using the 'Bearer' scheme. Bearer param.Field[ToolExecParamsHTTPAllowAuthBearer] `json:"bearer"` Query param.Field[ToolExecParamsHTTPAllowAuthQuery] `json:"query"` }
Authentication configuration for outbound requests to this host.
func (ToolExecParamsHTTPAllowAuth) MarshalJSON ¶
func (r ToolExecParamsHTTPAllowAuth) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTPAllowAuthBasic ¶
type ToolExecParamsHTTPAllowAuthBasic struct { Password param.Field[string] `json:"password"` SecretID param.Field[string] `json:"secret_id"` UserID param.Field[string] `json:"user_id"` }
func (ToolExecParamsHTTPAllowAuthBasic) MarshalJSON ¶
func (r ToolExecParamsHTTPAllowAuthBasic) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTPAllowAuthBearer ¶
type ToolExecParamsHTTPAllowAuthBearer struct { // The token to set, e.g. 'Authorization: Bearer <token>'. Token param.Field[string] `json:"token"` SecretID param.Field[string] `json:"secret_id"` }
Configuration to add an 'Authorization' header using the 'Bearer' scheme.
func (ToolExecParamsHTTPAllowAuthBearer) MarshalJSON ¶
func (r ToolExecParamsHTTPAllowAuthBearer) MarshalJSON() (data []byte, err error)
type ToolExecParamsHTTPAllowAuthQuery ¶
type ToolExecParamsHTTPAllowAuthQuery struct { Key param.Field[string] `json:"key"` SecretID param.Field[string] `json:"secret_id"` Value param.Field[string] `json:"value"` }
func (ToolExecParamsHTTPAllowAuthQuery) MarshalJSON ¶
func (r ToolExecParamsHTTPAllowAuthQuery) MarshalJSON() (data []byte, err error)
type ToolExecResponse ¶
type ToolExecResponse struct { // The execution details of the function. Execution ToolExecResponseExecution `json:"execution,required"` // The returned value of the Tool's execute function. Output interface{} `json:"output,required"` // The status of the output. "valid" means your Tool executed successfully and // returned a valid JSON-serializable object, or void. "json_serialization_error" // means your Tool executed successfully, but returned a nonserializable object. // "error" means your Tool failed to execute. OutputStatus ToolExecResponseOutputStatus `json:"output_status,required"` JSON toolExecResponseJSON `json:"-"` }
func (*ToolExecResponse) UnmarshalJSON ¶
func (r *ToolExecResponse) UnmarshalJSON(data []byte) (err error)
type ToolExecResponseExecution ¶
type ToolExecResponseExecution struct { // The ID of the execution. ID string `json:"id,required"` // The execution time of the function in milliseconds. Duration int64 `json:"duration,required"` // The exit code returned by the function. Will often be '0' on success and // non-zero on failure. ExitCode int64 `json:"exit_code,required"` // The contents of 'stderr' after executing the function. Stderr string `json:"stderr,required"` // The contents of 'stdout' after executing the function. Stdout string `json:"stdout,required"` JSON toolExecResponseExecutionJSON `json:"-"` }
The execution details of the function.
func (*ToolExecResponseExecution) UnmarshalJSON ¶
func (r *ToolExecResponseExecution) UnmarshalJSON(data []byte) (err error)
type ToolExecResponseOutputStatus ¶ added in v0.8.0
type ToolExecResponseOutputStatus string
The status of the output. "valid" means your Tool executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your Tool executed successfully, but returned a nonserializable object. "error" means your Tool failed to execute.
const ( ToolExecResponseOutputStatusError ToolExecResponseOutputStatus = "error" ToolExecResponseOutputStatusJsonSerializationError ToolExecResponseOutputStatus = "json_serialization_error" ToolExecResponseOutputStatusValid ToolExecResponseOutputStatus = "valid" )
func (ToolExecResponseOutputStatus) IsKnown ¶ added in v0.8.0
func (r ToolExecResponseOutputStatus) IsKnown() bool
type ToolLanguage ¶
type ToolLanguage string
The language of the tool's code.
const ( ToolLanguagePython ToolLanguage = "python" ToolLanguageJavascript ToolLanguage = "javascript" ToolLanguageTypescript ToolLanguage = "typescript" )
func (ToolLanguage) IsKnown ¶
func (r ToolLanguage) IsKnown() bool
type ToolListParams ¶ added in v0.11.0
type ToolListParams struct { // The number of items to return. Defaults to 100. Maximum is 100. Limit param.Field[int64] `query:"limit"` // The ID of the item to start after. To get the next page of results, set this to // the ID of the last item in the current page. StartingAfter param.Field[string] `query:"starting_after"` }
func (ToolListParams) URLQuery ¶ added in v0.11.0
func (r ToolListParams) URLQuery() (v url.Values)
URLQuery serializes ToolListParams's query parameters as `url.Values`.
type ToolNewParams ¶
type ToolNewParams struct { // The code of the tool. You must define a function named "execute" that takes in a // single argument and returns a JSON-serializable value. The argument will be the // "input" passed when executing the tool, and will match the input schema. Code param.Field[string] `json:"code,required"` // The language of the tool's code. Language param.Field[ToolNewParamsLanguage] `json:"language,required"` // The name of the tool. Name param.Field[string] `json:"name,required"` // A description of the tool. Description param.Field[string] `json:"description"` // The input schema of the tool. This must be a valid JSON Schema object. InputSchema param.Field[interface{}] `json:"input_schema"` // The ID of the runtime revision to use when executing the tool. RuntimeRevisionID param.Field[string] `json:"runtime_revision_id"` }
func (ToolNewParams) MarshalJSON ¶
func (r ToolNewParams) MarshalJSON() (data []byte, err error)
type ToolNewParamsLanguage ¶
type ToolNewParamsLanguage string
The language of the tool's code.
const ( ToolNewParamsLanguagePython ToolNewParamsLanguage = "python" ToolNewParamsLanguageJavascript ToolNewParamsLanguage = "javascript" ToolNewParamsLanguageTypescript ToolNewParamsLanguage = "typescript" )
func (ToolNewParamsLanguage) IsKnown ¶
func (r ToolNewParamsLanguage) IsKnown() bool
type ToolService ¶
type ToolService struct {
Options []option.RequestOption
}
ToolService contains methods and other services that help with interacting with the riza API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolService method instead.
func NewToolService ¶
func NewToolService(opts ...option.RequestOption) (r *ToolService)
NewToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolService) Exec ¶
func (r *ToolService) Exec(ctx context.Context, id string, body ToolExecParams, opts ...option.RequestOption) (res *ToolExecResponse, err error)
Execute a tool with a given input. The input is validated against the tool's input schema.
func (*ToolService) Get ¶
func (r *ToolService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Tool, err error)
Retrieves a tool.
func (*ToolService) List ¶
func (r *ToolService) List(ctx context.Context, query ToolListParams, opts ...option.RequestOption) (res *pagination.ToolsPagination[Tool], err error)
Returns a list of tools in your project.
func (*ToolService) ListAutoPaging ¶ added in v0.11.0
func (r *ToolService) ListAutoPaging(ctx context.Context, query ToolListParams, opts ...option.RequestOption) *pagination.ToolsPaginationAutoPager[Tool]
Returns a list of tools in your project.
func (*ToolService) New ¶
func (r *ToolService) New(ctx context.Context, body ToolNewParams, opts ...option.RequestOption) (res *Tool, err error)
Create a tool in your project.
func (*ToolService) Update ¶
func (r *ToolService) Update(ctx context.Context, id string, body ToolUpdateParams, opts ...option.RequestOption) (res *Tool, err error)
Update the source code and input schema of a tool.
type ToolUpdateParams ¶
type ToolUpdateParams struct { // The code of the tool. You must define a function named "execute" that takes in a // single argument and returns a JSON-serializable value. The argument will be the // "input" passed when executing the tool, and will match the input schema. Code param.Field[string] `json:"code"` // A description of the tool. Description param.Field[string] `json:"description"` // The input schema of the tool. This must be a valid JSON Schema object. InputSchema param.Field[interface{}] `json:"input_schema"` // The language of the tool's code. Language param.Field[ToolUpdateParamsLanguage] `json:"language"` // The name of the tool. Name param.Field[string] `json:"name"` // The ID of the custom runtime revision that the tool uses for executions. This is // used to pin executions to a specific version of a custom runtime, even if the // runtime is updated later. RuntimeRevisionID param.Field[string] `json:"runtime_revision_id"` }
func (ToolUpdateParams) MarshalJSON ¶
func (r ToolUpdateParams) MarshalJSON() (data []byte, err error)
type ToolUpdateParamsLanguage ¶
type ToolUpdateParamsLanguage string
The language of the tool's code.
const ( ToolUpdateParamsLanguagePython ToolUpdateParamsLanguage = "python" ToolUpdateParamsLanguageJavascript ToolUpdateParamsLanguage = "javascript" ToolUpdateParamsLanguageTypescript ToolUpdateParamsLanguage = "typescript" )
func (ToolUpdateParamsLanguage) IsKnown ¶
func (r ToolUpdateParamsLanguage) IsKnown() bool