Documentation
¶
Index ¶
- Constants
- func ClientWithHost(c client.Client, apiHost string) client.Client
- func ClientWithHostAndToken(c client.Client, apiHost, apiToken string) client.Client
- func ClientWithToken(c client.Client, apiToken string) client.Client
- func CreateConfigRequest(branchId BranchID, name string) client.APIRequest[*storageapi.ConfigWithRows]
- func CreateJobRequest(configId ConfigID, sandboxType string, opts ...Option) client.APIRequest[client.NoResult]
- func Delete(ctx context.Context, storageClient client.Sender, queueClient client.Sender, ...) error
- func DeleteConfigRequest(branchId BranchID, configId ConfigID) client.APIRequest[client.NoResult]
- func DeleteJobRequest(configId ConfigID, sandboxId SandboxID) client.APIRequest[client.NoResult]
- func GetConfigRequest(branchId BranchID, configId ConfigID) client.APIRequest[*storageapi.Config]
- func GetInstanceRequest(sandboxId SandboxID) client.APIRequest[*Sandbox]
- func ListConfigRequest(branchId BranchID) client.APIRequest[*[]*storageapi.Config]
- func ListInstancesRequest() client.APIRequest[*[]*Sandbox]
- func SizesMap() map[string]bool
- func SizesOrdered() []string
- func SupportsSizes(typ string) bool
- func TypesMap() map[string]bool
- func TypesOrdered() []string
- type BranchID
- type ConfigID
- type Details
- type DurationSeconds
- type Error
- type Option
- type Sandbox
- type SandboxID
- type SandboxWithConfig
- func Create(ctx context.Context, storageClient client.Sender, queueClient client.Sender, ...) (*SandboxWithConfig, error)
- func Get(ctx context.Context, storageClient client.Sender, sandboxClient client.Sender, ...) (*SandboxWithConfig, error)
- func List(ctx context.Context, storageClient client.Sender, sandboxClient client.Sender, ...) ([]*SandboxWithConfig, error)
- type Time
Constants ¶
const ( SizeSmall = "small" SizeMedium = "medium" SizeLarge = "large" )
const ( TypeSnowflake = "snowflake" TypePython = "python" TypeR = "r" )
const Component = "keboola.sandboxes"
const TimeFormat = "2006-01-02T15:04:05Z"
TimeFormat used in Sandbox API.
Variables ¶
This section is empty.
Functions ¶
func ClientWithHost ¶
ClientWithHost returns HTTP client with api host set.
func ClientWithHostAndToken ¶
ClientWithHostAndToken returns HTTP client with api host and token set.
func ClientWithToken ¶
ClientWithToken returns HTTP client with api token set.
func CreateConfigRequest ¶
func CreateConfigRequest(branchId BranchID, name string) client.APIRequest[*storageapi.ConfigWithRows]
func CreateJobRequest ¶
func DeleteConfigRequest ¶
func DeleteJobRequest ¶
func GetConfigRequest ¶
func GetConfigRequest(branchId BranchID, configId ConfigID) client.APIRequest[*storageapi.Config]
func GetInstanceRequest ¶ added in v0.7.0
func GetInstanceRequest(sandboxId SandboxID) client.APIRequest[*Sandbox]
func ListConfigRequest ¶
func ListConfigRequest(branchId BranchID) client.APIRequest[*[]*storageapi.Config]
func ListInstancesRequest ¶ added in v0.7.0
func ListInstancesRequest() client.APIRequest[*[]*Sandbox]
func SizesOrdered ¶
func SizesOrdered() []string
func SupportsSizes ¶
func TypesOrdered ¶
func TypesOrdered() []string
Types ¶
type BranchID ¶
type BranchID = storageapi.BranchID
type ConfigID ¶
type ConfigID = storageapi.ConfigID
type DurationSeconds ¶
DurationSeconds is time.Duration encoded/decoded as number of seconds.
func (DurationSeconds) MarshalJSON ¶
func (d DurationSeconds) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding.
func (DurationSeconds) String ¶
func (d DurationSeconds) String() string
func (*DurationSeconds) UnmarshalJSON ¶
func (d *DurationSeconds) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding.
type Error ¶
type Error struct { Message string `json:"messsage"` ErrorInfo string `json:"error"` // contains filtered or unexported fields }
Error represents the structure of Storage API error.
func (Error) ErrorUserMessage ¶
ErrorUserMessage returns error message for end user.
func (*Error) SetRequest ¶
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*Error) SetResponse ¶
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
type Option ¶
type Option func(p *params)
func WithExpireAfterHours ¶
func WithImageVersion ¶
func WithShared ¶
type Sandbox ¶
type Sandbox struct { ID SandboxID `json:"id"` Type string `json:"type"` Size string `json:"size"` // Only exists for container sandboxes (Python, R) Active bool `json:"active"` User string `json:"user"` Host string `json:"host"` Url string `json:"url"` Password string `json:"password"` Created Time `json:"createdTimestamp"` Updated Time `json:"updatedTimestamp"` Start Time `json:"startTimestamp"` // Workspace details - only exists for Snowflake sandboxes Details *Details `json:"workspaceDetails"` }
type SandboxID ¶
type SandboxID string
func GetSandboxID ¶
func GetSandboxID(c *storageapi.Config) (SandboxID, error)
type SandboxWithConfig ¶ added in v0.7.0
type SandboxWithConfig struct { Sandbox *Sandbox Config *storageapi.Config }
func (SandboxWithConfig) String ¶ added in v0.7.0
func (v SandboxWithConfig) String() string
type Time ¶
Time is encoded/decoded in TimeFormat used in Sandbox API.
func (Time) MarshalJSON ¶
MarshalJSON implements JSON encoding.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding.