Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AppAction
- type AppDeploymentFollowResponseState
- type AppDeploymentFollowResponseStateUpdate
- type AppDeploymentFollowResponseUnion
- func (u AppDeploymentFollowResponseUnion) AsAny() anyAppDeploymentFollowResponse
- func (u AppDeploymentFollowResponseUnion) AsLog() (v shared.LogEvent)
- func (u AppDeploymentFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
- func (u AppDeploymentFollowResponseUnion) AsState() (v AppDeploymentFollowResponseState)
- func (u AppDeploymentFollowResponseUnion) AsStateUpdate() (v AppDeploymentFollowResponseStateUpdate)
- func (u AppDeploymentFollowResponseUnion) RawJSON() string
- func (r *AppDeploymentFollowResponseUnion) UnmarshalJSON(data []byte) error
- type AppDeploymentNewParams
- type AppDeploymentNewParamsRegion
- type AppDeploymentNewResponse
- type AppDeploymentNewResponseApp
- type AppDeploymentNewResponseStatus
- type AppDeploymentService
- func (r *AppDeploymentService) FollowStreaming(ctx context.Context, id string, opts ...option.RequestOption) (stream *ssestream.Stream[AppDeploymentFollowResponseUnion])
- func (r *AppDeploymentService) New(ctx context.Context, body AppDeploymentNewParams, opts ...option.RequestOption) (res *AppDeploymentNewResponse, err error)
- type AppListParams
- type AppListResponse
- type AppService
- type BrowserDeleteParams
- type BrowserGetResponse
- type BrowserListResponse
- type BrowserNewParams
- type BrowserNewResponse
- type BrowserPersistence
- type BrowserPersistenceParam
- type BrowserService
- func (r *BrowserService) Delete(ctx context.Context, body BrowserDeleteParams, opts ...option.RequestOption) (err error)
- func (r *BrowserService) DeleteByID(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *BrowserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *BrowserGetResponse, err error)
- func (r *BrowserService) GetReplay(ctx context.Context, id string, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *BrowserService) List(ctx context.Context, opts ...option.RequestOption) (res *[]BrowserListResponse, err error)
- func (r *BrowserService) New(ctx context.Context, body BrowserNewParams, opts ...option.RequestOption) (res *BrowserNewResponse, err error)
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type DeploymentFollowParams
- type DeploymentFollowResponseAppVersionSummaryEvent
- type DeploymentFollowResponseUnion
- func (u DeploymentFollowResponseUnion) AsDeploymentFollowResponseAppVersionSummaryEvent() (v DeploymentFollowResponseAppVersionSummaryEvent)
- func (u DeploymentFollowResponseUnion) AsDeploymentState() (v DeploymentStateEvent)
- func (u DeploymentFollowResponseUnion) AsErrorEvent() (v shared.ErrorEvent)
- func (u DeploymentFollowResponseUnion) AsLog() (v shared.LogEvent)
- func (u DeploymentFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
- func (u DeploymentFollowResponseUnion) RawJSON() string
- func (r *DeploymentFollowResponseUnion) UnmarshalJSON(data []byte) error
- type DeploymentGetResponse
- type DeploymentGetResponseStatus
- type DeploymentListParams
- type DeploymentListResponse
- type DeploymentListResponseStatus
- type DeploymentNewParams
- type DeploymentNewParamsRegion
- type DeploymentNewResponse
- type DeploymentNewResponseStatus
- type DeploymentService
- func (r *DeploymentService) FollowStreaming(ctx context.Context, id string, query DeploymentFollowParams, ...) (stream *ssestream.Stream[DeploymentFollowResponseUnion])
- func (r *DeploymentService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DeploymentGetResponse, err error)
- func (r *DeploymentService) List(ctx context.Context, query DeploymentListParams, opts ...option.RequestOption) (res *[]DeploymentListResponse, err error)
- func (r *DeploymentService) New(ctx context.Context, body DeploymentNewParams, opts ...option.RequestOption) (res *DeploymentNewResponse, err error)
- type DeploymentStateEvent
- type DeploymentStateEventDeployment
- type Error
- type ErrorDetail
- type ErrorEvent
- type ErrorModel
- type HeartbeatEvent
- type InvocationFollowResponseUnion
- func (u InvocationFollowResponseUnion) AsAny() anyInvocationFollowResponse
- func (u InvocationFollowResponseUnion) AsError() (v shared.ErrorEvent)
- func (u InvocationFollowResponseUnion) AsInvocationState() (v InvocationStateEvent)
- func (u InvocationFollowResponseUnion) AsLog() (v shared.LogEvent)
- func (u InvocationFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
- func (u InvocationFollowResponseUnion) RawJSON() string
- func (r *InvocationFollowResponseUnion) UnmarshalJSON(data []byte) error
- type InvocationGetResponse
- type InvocationGetResponseStatus
- type InvocationNewParams
- type InvocationNewResponse
- type InvocationNewResponseStatus
- type InvocationService
- func (r *InvocationService) DeleteBrowsers(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *InvocationService) FollowStreaming(ctx context.Context, id string, opts ...option.RequestOption) (stream *ssestream.Stream[InvocationFollowResponseUnion])
- func (r *InvocationService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *InvocationGetResponse, err error)
- func (r *InvocationService) New(ctx context.Context, body InvocationNewParams, opts ...option.RequestOption) (res *InvocationNewResponse, err error)
- func (r *InvocationService) Update(ctx context.Context, id string, body InvocationUpdateParams, ...) (res *InvocationUpdateResponse, err error)
- type InvocationStateEvent
- type InvocationStateEventInvocation
- type InvocationUpdateParams
- type InvocationUpdateParamsStatus
- type InvocationUpdateResponse
- type InvocationUpdateResponseStatus
- type LogEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (KERNEL_API_KEY, KERNEL_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AppAction ¶ added in v0.6.4
An action available on the app
This is an alias to an internal type.
type AppDeploymentFollowResponseState ¶
type AppDeploymentFollowResponseState struct { // Event type identifier (always "state"). Event constant.State `json:"event,required"` // Current application state (e.g., "deploying", "running", "succeeded", "failed"). State string `json:"state,required"` // Time the state was reported. Timestamp time.Time `json:"timestamp" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Event respjson.Field State respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Initial state of the application, emitted once when subscribing.
func (AppDeploymentFollowResponseState) ImplAppDeploymentFollowResponseUnion ¶ added in v0.6.0
func (AppDeploymentFollowResponseState) ImplAppDeploymentFollowResponseUnion()
func (AppDeploymentFollowResponseState) RawJSON ¶
func (r AppDeploymentFollowResponseState) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppDeploymentFollowResponseState) UnmarshalJSON ¶
func (r *AppDeploymentFollowResponseState) UnmarshalJSON(data []byte) error
type AppDeploymentFollowResponseStateUpdate ¶
type AppDeploymentFollowResponseStateUpdate struct { // Event type identifier (always "state_update"). Event constant.StateUpdate `json:"event,required"` // New application state (e.g., "running", "succeeded", "failed"). State string `json:"state,required"` // Time the state change occurred. Timestamp time.Time `json:"timestamp" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Event respjson.Field State respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An update emitted when the application's state changes.
func (AppDeploymentFollowResponseStateUpdate) ImplAppDeploymentFollowResponseUnion ¶ added in v0.6.0
func (AppDeploymentFollowResponseStateUpdate) ImplAppDeploymentFollowResponseUnion()
func (AppDeploymentFollowResponseStateUpdate) RawJSON ¶
func (r AppDeploymentFollowResponseStateUpdate) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppDeploymentFollowResponseStateUpdate) UnmarshalJSON ¶
func (r *AppDeploymentFollowResponseStateUpdate) UnmarshalJSON(data []byte) error
type AppDeploymentFollowResponseUnion ¶
type AppDeploymentFollowResponseUnion struct { // Any of "state", "state_update", "log", "sse_heartbeat". Event string `json:"event"` State string `json:"state"` Timestamp time.Time `json:"timestamp"` // This field is from variant [shared.LogEvent]. Message string `json:"message"` JSON struct { Event respjson.Field State respjson.Field Timestamp respjson.Field Message respjson.Field // contains filtered or unexported fields } `json:"-"` }
AppDeploymentFollowResponseUnion contains all possible properties and values from AppDeploymentFollowResponseState, AppDeploymentFollowResponseStateUpdate, shared.LogEvent, shared.HeartbeatEvent.
Use the AppDeploymentFollowResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (AppDeploymentFollowResponseUnion) AsAny ¶
func (u AppDeploymentFollowResponseUnion) AsAny() anyAppDeploymentFollowResponse
Use the following switch statement to find the correct variant
switch variant := AppDeploymentFollowResponseUnion.AsAny().(type) { case kernel.AppDeploymentFollowResponseState: case kernel.AppDeploymentFollowResponseStateUpdate: case shared.LogEvent: case shared.HeartbeatEvent: default: fmt.Errorf("no variant present") }
func (AppDeploymentFollowResponseUnion) AsLog ¶
func (u AppDeploymentFollowResponseUnion) AsLog() (v shared.LogEvent)
func (AppDeploymentFollowResponseUnion) AsSseHeartbeat ¶ added in v0.6.2
func (u AppDeploymentFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
func (AppDeploymentFollowResponseUnion) AsState ¶
func (u AppDeploymentFollowResponseUnion) AsState() (v AppDeploymentFollowResponseState)
func (AppDeploymentFollowResponseUnion) AsStateUpdate ¶
func (u AppDeploymentFollowResponseUnion) AsStateUpdate() (v AppDeploymentFollowResponseStateUpdate)
func (AppDeploymentFollowResponseUnion) RawJSON ¶
func (u AppDeploymentFollowResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppDeploymentFollowResponseUnion) UnmarshalJSON ¶
func (r *AppDeploymentFollowResponseUnion) UnmarshalJSON(data []byte) error
type AppDeploymentNewParams ¶
type AppDeploymentNewParams struct { // Relative path to the entrypoint of the application EntrypointRelPath string `json:"entrypoint_rel_path,required"` // ZIP file containing the application source directory File io.Reader `json:"file,omitzero,required" format:"binary"` // Allow overwriting an existing app version Force param.Opt[bool] `json:"force,omitzero"` // Version of the application. Can be any string. Version param.Opt[string] `json:"version,omitzero"` // Map of environment variables to set for the deployed application. Each key-value // pair represents an environment variable. EnvVars map[string]string `json:"env_vars,omitzero"` // Region for deployment. Currently we only support "aws.us-east-1a" // // Any of "aws.us-east-1a". Region AppDeploymentNewParamsRegion `json:"region,omitzero"` // contains filtered or unexported fields }
func (AppDeploymentNewParams) MarshalMultipart ¶
func (r AppDeploymentNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type AppDeploymentNewParamsRegion ¶
type AppDeploymentNewParamsRegion string
Region for deployment. Currently we only support "aws.us-east-1a"
const (
AppDeploymentNewParamsRegionAwsUsEast1a AppDeploymentNewParamsRegion = "aws.us-east-1a"
)
type AppDeploymentNewResponse ¶
type AppDeploymentNewResponse struct { // List of apps deployed Apps []AppDeploymentNewResponseApp `json:"apps,required"` // Current status of the deployment // // Any of "queued", "deploying", "succeeded", "failed". Status AppDeploymentNewResponseStatus `json:"status,required"` // Status reason StatusReason string `json:"status_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Apps respjson.Field Status respjson.Field StatusReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AppDeploymentNewResponse) RawJSON ¶
func (r AppDeploymentNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppDeploymentNewResponse) UnmarshalJSON ¶
func (r *AppDeploymentNewResponse) UnmarshalJSON(data []byte) error
type AppDeploymentNewResponseApp ¶
type AppDeploymentNewResponseApp struct { // ID for the app version deployed ID string `json:"id,required"` // List of actions available on the app Actions []shared.AppAction `json:"actions,required"` // Name of the app Name string `json:"name,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Actions respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AppDeploymentNewResponseApp) RawJSON ¶
func (r AppDeploymentNewResponseApp) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppDeploymentNewResponseApp) UnmarshalJSON ¶
func (r *AppDeploymentNewResponseApp) UnmarshalJSON(data []byte) error
type AppDeploymentNewResponseStatus ¶
type AppDeploymentNewResponseStatus string
Current status of the deployment
const ( AppDeploymentNewResponseStatusQueued AppDeploymentNewResponseStatus = "queued" AppDeploymentNewResponseStatusDeploying AppDeploymentNewResponseStatus = "deploying" AppDeploymentNewResponseStatusSucceeded AppDeploymentNewResponseStatus = "succeeded" AppDeploymentNewResponseStatusFailed AppDeploymentNewResponseStatus = "failed" )
type AppDeploymentService ¶
type AppDeploymentService struct {
Options []option.RequestOption
}
AppDeploymentService contains methods and other services that help with interacting with the kernel 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 NewAppDeploymentService method instead.
func NewAppDeploymentService ¶
func NewAppDeploymentService(opts ...option.RequestOption) (r AppDeploymentService)
NewAppDeploymentService 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 (*AppDeploymentService) FollowStreaming ¶
func (r *AppDeploymentService) FollowStreaming(ctx context.Context, id string, opts ...option.RequestOption) (stream *ssestream.Stream[AppDeploymentFollowResponseUnion])
Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and status updates for a deployed application. The stream terminates automatically once the application reaches a terminal state.
func (*AppDeploymentService) New ¶
func (r *AppDeploymentService) New(ctx context.Context, body AppDeploymentNewParams, opts ...option.RequestOption) (res *AppDeploymentNewResponse, err error)
Deploy a new application and associated actions to Kernel.
type AppListParams ¶
type AppListParams struct { // Filter results by application name. AppName param.Opt[string] `query:"app_name,omitzero" json:"-"` // Filter results by version label. Version param.Opt[string] `query:"version,omitzero" json:"-"` // contains filtered or unexported fields }
func (AppListParams) URLQuery ¶
func (r AppListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AppListParams's query parameters as `url.Values`.
type AppListResponse ¶
type AppListResponse struct { // Unique identifier for the app version ID string `json:"id,required"` // List of actions available on the app Actions []shared.AppAction `json:"actions,required"` // Name of the application AppName string `json:"app_name,required"` // Deployment ID Deployment string `json:"deployment,required"` // Environment variables configured for this app version EnvVars map[string]string `json:"env_vars,required"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Version label for the application Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Actions respjson.Field AppName respjson.Field Deployment respjson.Field EnvVars respjson.Field Region respjson.Field Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Summary of an application version.
func (AppListResponse) RawJSON ¶
func (r AppListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppListResponse) UnmarshalJSON ¶
func (r *AppListResponse) UnmarshalJSON(data []byte) error
type AppService ¶
type AppService struct { Options []option.RequestOption Deployments AppDeploymentService }
AppService contains methods and other services that help with interacting with the kernel 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 NewAppService method instead.
func NewAppService ¶
func NewAppService(opts ...option.RequestOption) (r AppService)
NewAppService 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 (*AppService) List ¶
func (r *AppService) List(ctx context.Context, query AppListParams, opts ...option.RequestOption) (res *[]AppListResponse, err error)
List applications. Optionally filter by app name and/or version label.
type BrowserDeleteParams ¶ added in v0.3.0
type BrowserDeleteParams struct { // Persistent browser identifier PersistentID string `query:"persistent_id,required" json:"-"` // contains filtered or unexported fields }
func (BrowserDeleteParams) URLQuery ¶ added in v0.3.0
func (r BrowserDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BrowserDeleteParams's query parameters as `url.Values`.
type BrowserGetResponse ¶
type BrowserGetResponse struct { // Websocket URL for Chrome DevTools Protocol connections to the browser session CdpWsURL string `json:"cdp_ws_url,required"` // Unique identifier for the browser session SessionID string `json:"session_id,required"` // Remote URL for live viewing the browser session. Only available for non-headless // browsers. BrowserLiveViewURL string `json:"browser_live_view_url"` // Optional persistence configuration for the browser session. Persistence BrowserPersistence `json:"persistence"` // Remote URL for viewing the browser session replay if enabled ReplayViewURL string `json:"replay_view_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CdpWsURL respjson.Field SessionID respjson.Field BrowserLiveViewURL respjson.Field Persistence respjson.Field ReplayViewURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowserGetResponse) RawJSON ¶
func (r BrowserGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowserGetResponse) UnmarshalJSON ¶
func (r *BrowserGetResponse) UnmarshalJSON(data []byte) error
type BrowserListResponse ¶ added in v0.3.0
type BrowserListResponse struct { // Websocket URL for Chrome DevTools Protocol connections to the browser session CdpWsURL string `json:"cdp_ws_url,required"` // Unique identifier for the browser session SessionID string `json:"session_id,required"` // Remote URL for live viewing the browser session. Only available for non-headless // browsers. BrowserLiveViewURL string `json:"browser_live_view_url"` // Optional persistence configuration for the browser session. Persistence BrowserPersistence `json:"persistence"` // Remote URL for viewing the browser session replay if enabled ReplayViewURL string `json:"replay_view_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CdpWsURL respjson.Field SessionID respjson.Field BrowserLiveViewURL respjson.Field Persistence respjson.Field ReplayViewURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowserListResponse) RawJSON ¶ added in v0.3.0
func (r BrowserListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowserListResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *BrowserListResponse) UnmarshalJSON(data []byte) error
type BrowserNewParams ¶
type BrowserNewParams struct { // If true, launches the browser using a headless image (no VNC/GUI). Defaults to // false. Headless param.Opt[bool] `json:"headless,omitzero"` // action invocation ID InvocationID param.Opt[string] `json:"invocation_id,omitzero"` // If true, enables replay recording of the browser session. Defaults to false. Replay param.Opt[bool] `json:"replay,omitzero"` // If true, launches the browser in stealth mode to reduce detection by anti-bot // mechanisms. Stealth param.Opt[bool] `json:"stealth,omitzero"` // Optional persistence configuration for the browser session. Persistence BrowserPersistenceParam `json:"persistence,omitzero"` // contains filtered or unexported fields }
func (BrowserNewParams) MarshalJSON ¶
func (r BrowserNewParams) MarshalJSON() (data []byte, err error)
func (*BrowserNewParams) UnmarshalJSON ¶
func (r *BrowserNewParams) UnmarshalJSON(data []byte) error
type BrowserNewResponse ¶
type BrowserNewResponse struct { // Websocket URL for Chrome DevTools Protocol connections to the browser session CdpWsURL string `json:"cdp_ws_url,required"` // Unique identifier for the browser session SessionID string `json:"session_id,required"` // Remote URL for live viewing the browser session. Only available for non-headless // browsers. BrowserLiveViewURL string `json:"browser_live_view_url"` // Optional persistence configuration for the browser session. Persistence BrowserPersistence `json:"persistence"` // Remote URL for viewing the browser session replay if enabled ReplayViewURL string `json:"replay_view_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CdpWsURL respjson.Field SessionID respjson.Field BrowserLiveViewURL respjson.Field Persistence respjson.Field ReplayViewURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowserNewResponse) RawJSON ¶
func (r BrowserNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowserNewResponse) UnmarshalJSON ¶
func (r *BrowserNewResponse) UnmarshalJSON(data []byte) error
type BrowserPersistence ¶ added in v0.3.0
type BrowserPersistence struct { // Unique identifier for the persistent browser session. ID string `json:"id,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Optional persistence configuration for the browser session.
func (BrowserPersistence) RawJSON ¶ added in v0.3.0
func (r BrowserPersistence) RawJSON() string
Returns the unmodified JSON received from the API
func (BrowserPersistence) ToParam ¶ added in v0.3.0
func (r BrowserPersistence) ToParam() BrowserPersistenceParam
ToParam converts this BrowserPersistence to a BrowserPersistenceParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BrowserPersistenceParam.Overrides()
func (*BrowserPersistence) UnmarshalJSON ¶ added in v0.3.0
func (r *BrowserPersistence) UnmarshalJSON(data []byte) error
type BrowserPersistenceParam ¶ added in v0.3.0
type BrowserPersistenceParam struct { // Unique identifier for the persistent browser session. ID string `json:"id,required"` // contains filtered or unexported fields }
Optional persistence configuration for the browser session.
The property ID is required.
func (BrowserPersistenceParam) MarshalJSON ¶ added in v0.3.0
func (r BrowserPersistenceParam) MarshalJSON() (data []byte, err error)
func (*BrowserPersistenceParam) UnmarshalJSON ¶ added in v0.3.0
func (r *BrowserPersistenceParam) UnmarshalJSON(data []byte) error
type BrowserService ¶
type BrowserService struct {
Options []option.RequestOption
}
BrowserService contains methods and other services that help with interacting with the kernel 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 NewBrowserService method instead.
func NewBrowserService ¶
func NewBrowserService(opts ...option.RequestOption) (r BrowserService)
NewBrowserService 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 (*BrowserService) Delete ¶ added in v0.3.0
func (r *BrowserService) Delete(ctx context.Context, body BrowserDeleteParams, opts ...option.RequestOption) (err error)
Delete a persistent browser session by its persistent_id.
func (*BrowserService) DeleteByID ¶ added in v0.3.0
func (r *BrowserService) DeleteByID(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Delete a browser session by ID
func (*BrowserService) Get ¶
func (r *BrowserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *BrowserGetResponse, err error)
Get information about a browser session.
func (*BrowserService) GetReplay ¶ added in v0.7.1
func (r *BrowserService) GetReplay(ctx context.Context, id string, opts ...option.RequestOption) (res *http.Response, err error)
Get browser session replay.
func (*BrowserService) List ¶ added in v0.3.0
func (r *BrowserService) List(ctx context.Context, opts ...option.RequestOption) (res *[]BrowserListResponse, err error)
List active browser sessions
func (*BrowserService) New ¶
func (r *BrowserService) New(ctx context.Context, body BrowserNewParams, opts ...option.RequestOption) (res *BrowserNewResponse, err error)
Create a new browser session from within an action.
type Client ¶
type Client struct { Options []option.RequestOption Deployments DeploymentService Apps AppService Invocations InvocationService Browsers BrowserService }
Client creates a struct with services and top level methods that help with interacting with the kernel 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 (KERNEL_API_KEY, KERNEL_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 any, res any, 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 any, res any, 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 any, res any, 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 any, res any, 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.
type DeploymentFollowParams ¶ added in v0.6.2
type DeploymentFollowParams struct { // Show logs since the given time (RFC timestamps or durations like 5m). Since param.Opt[string] `query:"since,omitzero" json:"-"` // contains filtered or unexported fields }
func (DeploymentFollowParams) URLQuery ¶ added in v0.6.2
func (r DeploymentFollowParams) URLQuery() (v url.Values, err error)
URLQuery serializes DeploymentFollowParams's query parameters as `url.Values`.
type DeploymentFollowResponseAppVersionSummaryEvent ¶ added in v0.6.0
type DeploymentFollowResponseAppVersionSummaryEvent struct { // Unique identifier for the app version ID string `json:"id,required"` // List of actions available on the app Actions []shared.AppAction `json:"actions,required"` // Name of the application AppName string `json:"app_name,required"` // Event type identifier (always "app_version_summary"). Event constant.AppVersionSummary `json:"event,required"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Time the state was reported. Timestamp time.Time `json:"timestamp,required" format:"date-time"` // Version label for the application Version string `json:"version,required"` // Environment variables configured for this app version EnvVars map[string]string `json:"env_vars"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Actions respjson.Field AppName respjson.Field Event respjson.Field Region respjson.Field Timestamp respjson.Field Version respjson.Field EnvVars respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Summary of an application version.
func (DeploymentFollowResponseAppVersionSummaryEvent) RawJSON ¶ added in v0.6.0
func (r DeploymentFollowResponseAppVersionSummaryEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentFollowResponseAppVersionSummaryEvent) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentFollowResponseAppVersionSummaryEvent) UnmarshalJSON(data []byte) error
type DeploymentFollowResponseUnion ¶ added in v0.6.0
type DeploymentFollowResponseUnion struct { // Any of "log", "deployment_state", nil, nil, "sse_heartbeat". Event string `json:"event"` // This field is from variant [shared.LogEvent]. Message string `json:"message"` Timestamp time.Time `json:"timestamp"` // This field is from variant [DeploymentStateEvent]. Deployment DeploymentStateEventDeployment `json:"deployment"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. ID string `json:"id"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. Actions []shared.AppAction `json:"actions"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. AppName string `json:"app_name"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. Region constant.AwsUsEast1a `json:"region"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. Version string `json:"version"` // This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent]. EnvVars map[string]string `json:"env_vars"` // This field is from variant [shared.ErrorEvent]. Error shared.ErrorModel `json:"error"` JSON struct { Event respjson.Field Message respjson.Field Timestamp respjson.Field Deployment respjson.Field ID respjson.Field Actions respjson.Field AppName respjson.Field Region respjson.Field Version respjson.Field EnvVars respjson.Field Error respjson.Field // contains filtered or unexported fields } `json:"-"` }
DeploymentFollowResponseUnion contains all possible properties and values from shared.LogEvent, DeploymentStateEvent, DeploymentFollowResponseAppVersionSummaryEvent, shared.ErrorEvent, shared.HeartbeatEvent.
Use the [DeploymentFollowResponseUnion.AsAny] method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (DeploymentFollowResponseUnion) AsDeploymentFollowResponseAppVersionSummaryEvent ¶ added in v0.6.0
func (u DeploymentFollowResponseUnion) AsDeploymentFollowResponseAppVersionSummaryEvent() (v DeploymentFollowResponseAppVersionSummaryEvent)
func (DeploymentFollowResponseUnion) AsDeploymentState ¶ added in v0.6.0
func (u DeploymentFollowResponseUnion) AsDeploymentState() (v DeploymentStateEvent)
func (DeploymentFollowResponseUnion) AsErrorEvent ¶ added in v0.6.0
func (u DeploymentFollowResponseUnion) AsErrorEvent() (v shared.ErrorEvent)
func (DeploymentFollowResponseUnion) AsLog ¶ added in v0.6.0
func (u DeploymentFollowResponseUnion) AsLog() (v shared.LogEvent)
func (DeploymentFollowResponseUnion) AsSseHeartbeat ¶ added in v0.6.2
func (u DeploymentFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
func (DeploymentFollowResponseUnion) RawJSON ¶ added in v0.6.0
func (u DeploymentFollowResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentFollowResponseUnion) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentFollowResponseUnion) UnmarshalJSON(data []byte) error
type DeploymentGetResponse ¶ added in v0.6.0
type DeploymentGetResponse struct { // Unique identifier for the deployment ID string `json:"id,required"` // Timestamp when the deployment was created CreatedAt time.Time `json:"created_at,required" format:"date-time"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Current status of the deployment // // Any of "queued", "in_progress", "running", "failed", "stopped". Status DeploymentGetResponseStatus `json:"status,required"` // Relative path to the application entrypoint EntrypointRelPath string `json:"entrypoint_rel_path"` // Environment variables configured for this deployment EnvVars map[string]string `json:"env_vars"` // Status reason StatusReason string `json:"status_reason"` // Timestamp when the deployment was last updated UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Region respjson.Field Status respjson.Field EntrypointRelPath respjson.Field EnvVars respjson.Field StatusReason respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Deployment record information.
func (DeploymentGetResponse) RawJSON ¶ added in v0.6.0
func (r DeploymentGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentGetResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentGetResponse) UnmarshalJSON(data []byte) error
type DeploymentGetResponseStatus ¶ added in v0.6.0
type DeploymentGetResponseStatus string
Current status of the deployment
const ( DeploymentGetResponseStatusQueued DeploymentGetResponseStatus = "queued" DeploymentGetResponseStatusInProgress DeploymentGetResponseStatus = "in_progress" DeploymentGetResponseStatusRunning DeploymentGetResponseStatus = "running" DeploymentGetResponseStatusFailed DeploymentGetResponseStatus = "failed" DeploymentGetResponseStatusStopped DeploymentGetResponseStatus = "stopped" )
type DeploymentListParams ¶ added in v0.6.4
type DeploymentListParams struct { // Filter results by application name. AppName param.Opt[string] `query:"app_name,omitzero" json:"-"` // contains filtered or unexported fields }
func (DeploymentListParams) URLQuery ¶ added in v0.6.4
func (r DeploymentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DeploymentListParams's query parameters as `url.Values`.
type DeploymentListResponse ¶ added in v0.6.4
type DeploymentListResponse struct { // Unique identifier for the deployment ID string `json:"id,required"` // Timestamp when the deployment was created CreatedAt time.Time `json:"created_at,required" format:"date-time"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Current status of the deployment // // Any of "queued", "in_progress", "running", "failed", "stopped". Status DeploymentListResponseStatus `json:"status,required"` // Relative path to the application entrypoint EntrypointRelPath string `json:"entrypoint_rel_path"` // Environment variables configured for this deployment EnvVars map[string]string `json:"env_vars"` // Status reason StatusReason string `json:"status_reason"` // Timestamp when the deployment was last updated UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Region respjson.Field Status respjson.Field EntrypointRelPath respjson.Field EnvVars respjson.Field StatusReason respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Deployment record information.
func (DeploymentListResponse) RawJSON ¶ added in v0.6.4
func (r DeploymentListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentListResponse) UnmarshalJSON ¶ added in v0.6.4
func (r *DeploymentListResponse) UnmarshalJSON(data []byte) error
type DeploymentListResponseStatus ¶ added in v0.6.4
type DeploymentListResponseStatus string
Current status of the deployment
const ( DeploymentListResponseStatusQueued DeploymentListResponseStatus = "queued" DeploymentListResponseStatusInProgress DeploymentListResponseStatus = "in_progress" DeploymentListResponseStatusRunning DeploymentListResponseStatus = "running" DeploymentListResponseStatusFailed DeploymentListResponseStatus = "failed" DeploymentListResponseStatusStopped DeploymentListResponseStatus = "stopped" )
type DeploymentNewParams ¶ added in v0.6.0
type DeploymentNewParams struct { // Relative path to the entrypoint of the application EntrypointRelPath string `json:"entrypoint_rel_path,required"` // ZIP file containing the application source directory File io.Reader `json:"file,omitzero,required" format:"binary"` // Allow overwriting an existing app version Force param.Opt[bool] `json:"force,omitzero"` // Version of the application. Can be any string. Version param.Opt[string] `json:"version,omitzero"` // Map of environment variables to set for the deployed application. Each key-value // pair represents an environment variable. EnvVars map[string]string `json:"env_vars,omitzero"` // Region for deployment. Currently we only support "aws.us-east-1a" // // Any of "aws.us-east-1a". Region DeploymentNewParamsRegion `json:"region,omitzero"` // contains filtered or unexported fields }
func (DeploymentNewParams) MarshalMultipart ¶ added in v0.6.0
func (r DeploymentNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type DeploymentNewParamsRegion ¶ added in v0.6.0
type DeploymentNewParamsRegion string
Region for deployment. Currently we only support "aws.us-east-1a"
const (
DeploymentNewParamsRegionAwsUsEast1a DeploymentNewParamsRegion = "aws.us-east-1a"
)
type DeploymentNewResponse ¶ added in v0.6.0
type DeploymentNewResponse struct { // Unique identifier for the deployment ID string `json:"id,required"` // Timestamp when the deployment was created CreatedAt time.Time `json:"created_at,required" format:"date-time"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Current status of the deployment // // Any of "queued", "in_progress", "running", "failed", "stopped". Status DeploymentNewResponseStatus `json:"status,required"` // Relative path to the application entrypoint EntrypointRelPath string `json:"entrypoint_rel_path"` // Environment variables configured for this deployment EnvVars map[string]string `json:"env_vars"` // Status reason StatusReason string `json:"status_reason"` // Timestamp when the deployment was last updated UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Region respjson.Field Status respjson.Field EntrypointRelPath respjson.Field EnvVars respjson.Field StatusReason respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Deployment record information.
func (DeploymentNewResponse) RawJSON ¶ added in v0.6.0
func (r DeploymentNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentNewResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentNewResponse) UnmarshalJSON(data []byte) error
type DeploymentNewResponseStatus ¶ added in v0.6.0
type DeploymentNewResponseStatus string
Current status of the deployment
const ( DeploymentNewResponseStatusQueued DeploymentNewResponseStatus = "queued" DeploymentNewResponseStatusInProgress DeploymentNewResponseStatus = "in_progress" DeploymentNewResponseStatusRunning DeploymentNewResponseStatus = "running" DeploymentNewResponseStatusFailed DeploymentNewResponseStatus = "failed" DeploymentNewResponseStatusStopped DeploymentNewResponseStatus = "stopped" )
type DeploymentService ¶ added in v0.6.0
type DeploymentService struct {
Options []option.RequestOption
}
DeploymentService contains methods and other services that help with interacting with the kernel 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 NewDeploymentService method instead.
func NewDeploymentService ¶ added in v0.6.0
func NewDeploymentService(opts ...option.RequestOption) (r DeploymentService)
NewDeploymentService 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 (*DeploymentService) FollowStreaming ¶ added in v0.6.0
func (r *DeploymentService) FollowStreaming(ctx context.Context, id string, query DeploymentFollowParams, opts ...option.RequestOption) (stream *ssestream.Stream[DeploymentFollowResponseUnion])
Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and status updates for a deployment. The stream terminates automatically once the deployment reaches a terminal state.
func (*DeploymentService) Get ¶ added in v0.6.0
func (r *DeploymentService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DeploymentGetResponse, err error)
Get information about a deployment's status.
func (*DeploymentService) List ¶ added in v0.6.4
func (r *DeploymentService) List(ctx context.Context, query DeploymentListParams, opts ...option.RequestOption) (res *[]DeploymentListResponse, err error)
List deployments. Optionally filter by application name.
func (*DeploymentService) New ¶ added in v0.6.0
func (r *DeploymentService) New(ctx context.Context, body DeploymentNewParams, opts ...option.RequestOption) (res *DeploymentNewResponse, err error)
Create a new deployment.
type DeploymentStateEvent ¶ added in v0.6.0
type DeploymentStateEvent struct { // Deployment record information. Deployment DeploymentStateEventDeployment `json:"deployment,required"` // Event type identifier (always "deployment_state"). Event constant.DeploymentState `json:"event,required"` // Time the state was reported. Timestamp time.Time `json:"timestamp,required" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Deployment respjson.Field Event respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An event representing the current state of a deployment.
func (DeploymentStateEvent) RawJSON ¶ added in v0.6.0
func (r DeploymentStateEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentStateEvent) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentStateEvent) UnmarshalJSON(data []byte) error
type DeploymentStateEventDeployment ¶ added in v0.6.0
type DeploymentStateEventDeployment struct { // Unique identifier for the deployment ID string `json:"id,required"` // Timestamp when the deployment was created CreatedAt time.Time `json:"created_at,required" format:"date-time"` // Deployment region code Region constant.AwsUsEast1a `json:"region,required"` // Current status of the deployment // // Any of "queued", "in_progress", "running", "failed", "stopped". Status string `json:"status,required"` // Relative path to the application entrypoint EntrypointRelPath string `json:"entrypoint_rel_path"` // Environment variables configured for this deployment EnvVars map[string]string `json:"env_vars"` // Status reason StatusReason string `json:"status_reason"` // Timestamp when the deployment was last updated UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Region respjson.Field Status respjson.Field EntrypointRelPath respjson.Field EnvVars respjson.Field StatusReason respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Deployment record information.
func (DeploymentStateEventDeployment) RawJSON ¶ added in v0.6.0
func (r DeploymentStateEventDeployment) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentStateEventDeployment) UnmarshalJSON ¶ added in v0.6.0
func (r *DeploymentStateEventDeployment) UnmarshalJSON(data []byte) error
type ErrorDetail ¶ added in v0.6.0
type ErrorDetail = shared.ErrorDetail
This is an alias to an internal type.
type ErrorEvent ¶ added in v0.6.0
type ErrorEvent = shared.ErrorEvent
An error event from the application.
This is an alias to an internal type.
type ErrorModel ¶ added in v0.6.0
type ErrorModel = shared.ErrorModel
This is an alias to an internal type.
type HeartbeatEvent ¶ added in v0.6.2
type HeartbeatEvent = shared.HeartbeatEvent
Heartbeat event sent periodically to keep SSE connection alive.
This is an alias to an internal type.
type InvocationFollowResponseUnion ¶ added in v0.6.0
type InvocationFollowResponseUnion struct { // Any of "log", "invocation_state", "error", "sse_heartbeat". Event string `json:"event"` // This field is from variant [shared.LogEvent]. Message string `json:"message"` Timestamp time.Time `json:"timestamp"` // This field is from variant [InvocationStateEvent]. Invocation InvocationStateEventInvocation `json:"invocation"` // This field is from variant [shared.ErrorEvent]. Error shared.ErrorModel `json:"error"` JSON struct { Event respjson.Field Message respjson.Field Timestamp respjson.Field Invocation respjson.Field Error respjson.Field // contains filtered or unexported fields } `json:"-"` }
InvocationFollowResponseUnion contains all possible properties and values from shared.LogEvent, InvocationStateEvent, shared.ErrorEvent, shared.HeartbeatEvent.
Use the InvocationFollowResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (InvocationFollowResponseUnion) AsAny ¶ added in v0.6.0
func (u InvocationFollowResponseUnion) AsAny() anyInvocationFollowResponse
Use the following switch statement to find the correct variant
switch variant := InvocationFollowResponseUnion.AsAny().(type) { case shared.LogEvent: case kernel.InvocationStateEvent: case shared.ErrorEvent: case shared.HeartbeatEvent: default: fmt.Errorf("no variant present") }
func (InvocationFollowResponseUnion) AsError ¶ added in v0.6.0
func (u InvocationFollowResponseUnion) AsError() (v shared.ErrorEvent)
func (InvocationFollowResponseUnion) AsInvocationState ¶ added in v0.6.0
func (u InvocationFollowResponseUnion) AsInvocationState() (v InvocationStateEvent)
func (InvocationFollowResponseUnion) AsLog ¶ added in v0.6.0
func (u InvocationFollowResponseUnion) AsLog() (v shared.LogEvent)
func (InvocationFollowResponseUnion) AsSseHeartbeat ¶ added in v0.6.2
func (u InvocationFollowResponseUnion) AsSseHeartbeat() (v shared.HeartbeatEvent)
func (InvocationFollowResponseUnion) RawJSON ¶ added in v0.6.0
func (u InvocationFollowResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationFollowResponseUnion) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationFollowResponseUnion) UnmarshalJSON(data []byte) error
type InvocationGetResponse ¶ added in v0.6.0
type InvocationGetResponse struct { // ID of the invocation ID string `json:"id,required"` // Name of the action invoked ActionName string `json:"action_name,required"` // Name of the application AppName string `json:"app_name,required"` // RFC 3339 Nanoseconds timestamp when the invocation started StartedAt time.Time `json:"started_at,required" format:"date-time"` // Status of the invocation // // Any of "queued", "running", "succeeded", "failed". Status InvocationGetResponseStatus `json:"status,required"` // RFC 3339 Nanoseconds timestamp when the invocation finished (null if still // running) FinishedAt time.Time `json:"finished_at,nullable" format:"date-time"` // Output produced by the action, rendered as a JSON string. This could be: string, // number, boolean, array, object, or null. Output string `json:"output"` // Payload provided to the invocation. This is a string that can be parsed as JSON. Payload string `json:"payload"` // Status reason StatusReason string `json:"status_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ActionName respjson.Field AppName respjson.Field StartedAt respjson.Field Status respjson.Field FinishedAt respjson.Field Output respjson.Field Payload respjson.Field StatusReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (InvocationGetResponse) RawJSON ¶ added in v0.6.0
func (r InvocationGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationGetResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationGetResponse) UnmarshalJSON(data []byte) error
type InvocationGetResponseStatus ¶ added in v0.6.0
type InvocationGetResponseStatus string
Status of the invocation
const ( InvocationGetResponseStatusQueued InvocationGetResponseStatus = "queued" InvocationGetResponseStatusRunning InvocationGetResponseStatus = "running" InvocationGetResponseStatusSucceeded InvocationGetResponseStatus = "succeeded" InvocationGetResponseStatusFailed InvocationGetResponseStatus = "failed" )
type InvocationNewParams ¶ added in v0.6.0
type InvocationNewParams struct { // Name of the action to invoke ActionName string `json:"action_name,required"` // Name of the application AppName string `json:"app_name,required"` // Version of the application Version string `json:"version,required"` // If true, invoke asynchronously. When set, the API responds 202 Accepted with // status "queued". Async param.Opt[bool] `json:"async,omitzero"` // Input data for the action, sent as a JSON string. Payload param.Opt[string] `json:"payload,omitzero"` // contains filtered or unexported fields }
func (InvocationNewParams) MarshalJSON ¶ added in v0.6.0
func (r InvocationNewParams) MarshalJSON() (data []byte, err error)
func (*InvocationNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationNewParams) UnmarshalJSON(data []byte) error
type InvocationNewResponse ¶ added in v0.6.0
type InvocationNewResponse struct { // ID of the invocation ID string `json:"id,required"` // Status of the invocation // // Any of "queued", "running", "succeeded", "failed". Status InvocationNewResponseStatus `json:"status,required"` // The return value of the action that was invoked, rendered as a JSON string. This // could be: string, number, boolean, array, object, or null. Output string `json:"output"` // Status reason StatusReason string `json:"status_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Status respjson.Field Output respjson.Field StatusReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (InvocationNewResponse) RawJSON ¶ added in v0.6.0
func (r InvocationNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationNewResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationNewResponse) UnmarshalJSON(data []byte) error
type InvocationNewResponseStatus ¶ added in v0.6.0
type InvocationNewResponseStatus string
Status of the invocation
const ( InvocationNewResponseStatusQueued InvocationNewResponseStatus = "queued" InvocationNewResponseStatusRunning InvocationNewResponseStatus = "running" InvocationNewResponseStatusSucceeded InvocationNewResponseStatus = "succeeded" InvocationNewResponseStatusFailed InvocationNewResponseStatus = "failed" )
type InvocationService ¶ added in v0.6.0
type InvocationService struct {
Options []option.RequestOption
}
InvocationService contains methods and other services that help with interacting with the kernel 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 NewInvocationService method instead.
func NewInvocationService ¶ added in v0.6.0
func NewInvocationService(opts ...option.RequestOption) (r InvocationService)
NewInvocationService 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 (*InvocationService) DeleteBrowsers ¶ added in v0.6.1
func (r *InvocationService) DeleteBrowsers(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Delete all browser sessions created within the specified invocation.
func (*InvocationService) FollowStreaming ¶ added in v0.6.0
func (r *InvocationService) FollowStreaming(ctx context.Context, id string, opts ...option.RequestOption) (stream *ssestream.Stream[InvocationFollowResponseUnion])
Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and status updates for an invocation. The stream terminates automatically once the invocation reaches a terminal state.
func (*InvocationService) Get ¶ added in v0.6.0
func (r *InvocationService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *InvocationGetResponse, err error)
Get details about an invocation's status and output.
func (*InvocationService) New ¶ added in v0.6.0
func (r *InvocationService) New(ctx context.Context, body InvocationNewParams, opts ...option.RequestOption) (res *InvocationNewResponse, err error)
Invoke an action.
func (*InvocationService) Update ¶ added in v0.6.0
func (r *InvocationService) Update(ctx context.Context, id string, body InvocationUpdateParams, opts ...option.RequestOption) (res *InvocationUpdateResponse, err error)
Update an invocation's status or output.
type InvocationStateEvent ¶ added in v0.6.0
type InvocationStateEvent struct { // Event type identifier (always "invocation_state"). Event constant.InvocationState `json:"event,required"` Invocation InvocationStateEventInvocation `json:"invocation,required"` // Time the state was reported. Timestamp time.Time `json:"timestamp,required" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Event respjson.Field Invocation respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An event representing the current state of an invocation.
func (InvocationStateEvent) ImplInvocationFollowResponseUnion ¶ added in v0.6.0
func (InvocationStateEvent) ImplInvocationFollowResponseUnion()
func (InvocationStateEvent) RawJSON ¶ added in v0.6.0
func (r InvocationStateEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationStateEvent) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationStateEvent) UnmarshalJSON(data []byte) error
type InvocationStateEventInvocation ¶ added in v0.6.0
type InvocationStateEventInvocation struct { // ID of the invocation ID string `json:"id,required"` // Name of the action invoked ActionName string `json:"action_name,required"` // Name of the application AppName string `json:"app_name,required"` // RFC 3339 Nanoseconds timestamp when the invocation started StartedAt time.Time `json:"started_at,required" format:"date-time"` // Status of the invocation // // Any of "queued", "running", "succeeded", "failed". Status string `json:"status,required"` // RFC 3339 Nanoseconds timestamp when the invocation finished (null if still // running) FinishedAt time.Time `json:"finished_at,nullable" format:"date-time"` // Output produced by the action, rendered as a JSON string. This could be: string, // number, boolean, array, object, or null. Output string `json:"output"` // Payload provided to the invocation. This is a string that can be parsed as JSON. Payload string `json:"payload"` // Status reason StatusReason string `json:"status_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ActionName respjson.Field AppName respjson.Field StartedAt respjson.Field Status respjson.Field FinishedAt respjson.Field Output respjson.Field Payload respjson.Field StatusReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (InvocationStateEventInvocation) RawJSON ¶ added in v0.6.0
func (r InvocationStateEventInvocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationStateEventInvocation) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationStateEventInvocation) UnmarshalJSON(data []byte) error
type InvocationUpdateParams ¶ added in v0.6.0
type InvocationUpdateParams struct { // New status for the invocation. // // Any of "succeeded", "failed". Status InvocationUpdateParamsStatus `json:"status,omitzero,required"` // Updated output of the invocation rendered as JSON string. Output param.Opt[string] `json:"output,omitzero"` // contains filtered or unexported fields }
func (InvocationUpdateParams) MarshalJSON ¶ added in v0.6.0
func (r InvocationUpdateParams) MarshalJSON() (data []byte, err error)
func (*InvocationUpdateParams) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationUpdateParams) UnmarshalJSON(data []byte) error
type InvocationUpdateParamsStatus ¶ added in v0.6.0
type InvocationUpdateParamsStatus string
New status for the invocation.
const ( InvocationUpdateParamsStatusSucceeded InvocationUpdateParamsStatus = "succeeded" InvocationUpdateParamsStatusFailed InvocationUpdateParamsStatus = "failed" )
type InvocationUpdateResponse ¶ added in v0.6.0
type InvocationUpdateResponse struct { // ID of the invocation ID string `json:"id,required"` // Name of the action invoked ActionName string `json:"action_name,required"` // Name of the application AppName string `json:"app_name,required"` // RFC 3339 Nanoseconds timestamp when the invocation started StartedAt time.Time `json:"started_at,required" format:"date-time"` // Status of the invocation // // Any of "queued", "running", "succeeded", "failed". Status InvocationUpdateResponseStatus `json:"status,required"` // RFC 3339 Nanoseconds timestamp when the invocation finished (null if still // running) FinishedAt time.Time `json:"finished_at,nullable" format:"date-time"` // Output produced by the action, rendered as a JSON string. This could be: string, // number, boolean, array, object, or null. Output string `json:"output"` // Payload provided to the invocation. This is a string that can be parsed as JSON. Payload string `json:"payload"` // Status reason StatusReason string `json:"status_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ActionName respjson.Field AppName respjson.Field StartedAt respjson.Field Status respjson.Field FinishedAt respjson.Field Output respjson.Field Payload respjson.Field StatusReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (InvocationUpdateResponse) RawJSON ¶ added in v0.6.0
func (r InvocationUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InvocationUpdateResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *InvocationUpdateResponse) UnmarshalJSON(data []byte) error
type InvocationUpdateResponseStatus ¶ added in v0.6.0
type InvocationUpdateResponseStatus string
Status of the invocation
const ( InvocationUpdateResponseStatusQueued InvocationUpdateResponseStatus = "queued" InvocationUpdateResponseStatusRunning InvocationUpdateResponseStatus = "running" InvocationUpdateResponseStatusSucceeded InvocationUpdateResponseStatus = "succeeded" InvocationUpdateResponseStatusFailed InvocationUpdateResponseStatus = "failed" )
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
packages
|
|