Help us shape the future of Go! Take the 2026 Go Developer Survey

executions

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "kube-workspaces"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "1.0.0"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "executions"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [6]string{"status", "list", "get", "start", "manifest", "chunk"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewChunkEndpoint

func NewChunkEndpoint(s Service) goa.Endpoint

NewChunkEndpoint returns an endpoint function that calls the method "chunk" of service "executions".

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "get" of service "executions".

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "executions".

func NewManifestEndpoint

func NewManifestEndpoint(s Service) goa.Endpoint

NewManifestEndpoint returns an endpoint function that calls the method "manifest" of service "executions".

func NewStartEndpoint

func NewStartEndpoint(s Service) goa.Endpoint

NewStartEndpoint returns an endpoint function that calls the method "start" of service "executions".

func NewStatusEndpoint

func NewStatusEndpoint(s Service) goa.Endpoint

NewStatusEndpoint returns an endpoint function that calls the method "status" of service "executions".

func NewViewedExecutionCommand

func NewViewedExecutionCommand(res *ExecutionCommand, view string) *executionsviews.ExecutionCommand

NewViewedExecutionCommand initializes viewed result type ExecutionCommand from result type ExecutionCommand using the given view.

func NewViewedExecutionRecord

func NewViewedExecutionRecord(res *ExecutionRecord, view string) *executionsviews.ExecutionRecord

NewViewedExecutionRecord initializes viewed result type ExecutionRecord from result type ExecutionRecord using the given view.

func NewViewedExecutionStatus

func NewViewedExecutionStatus(res *ExecutionStatus, view string) *executionsviews.ExecutionStatus

NewViewedExecutionStatus initializes viewed result type ExecutionStatus from result type ExecutionStatus using the given view.

Types

type ChunkPayload

type ChunkPayload struct {
	ExecutionID string
	Index       uint64
}

ChunkPayload is the payload type of the executions service chunk method.

type Client

type Client struct {
	StatusEndpoint   goa.Endpoint
	ListEndpoint     goa.Endpoint
	GetEndpoint      goa.Endpoint
	StartEndpoint    goa.Endpoint
	ManifestEndpoint goa.Endpoint
	ChunkEndpoint    goa.Endpoint
}

Client is the "executions" service client.

func NewClient

func NewClient(status, list, get, start, manifest, chunk goa.Endpoint) *Client

NewClient initializes a "executions" service client given the endpoints.

func (*Client) Chunk

func (c *Client) Chunk(ctx context.Context, p *ChunkPayload) (res *ExecutionRecordingChunk, err error)

Chunk calls the "chunk" endpoint of the "executions" service. Chunk may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Get

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *ExecutionRecord, err error)

Get calls the "get" endpoint of the "executions" service. Get may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) List

func (c *Client) List(ctx context.Context, p *ListPayload) (res []*ExecutionRecord, err error)

List calls the "list" endpoint of the "executions" service. List may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Manifest

func (c *Client) Manifest(ctx context.Context, p *ManifestPayload) (res *ExecutionRecordingManifest, err error)

Manifest calls the "manifest" endpoint of the "executions" service. Manifest may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Start

func (c *Client) Start(ctx context.Context, p *StartPayload) (res *ExecutionCommand, err error)

Start calls the "start" endpoint of the "executions" service. Start may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Status

func (c *Client) Status(ctx context.Context) (res *ExecutionStatus, err error)

Status calls the "status" endpoint of the "executions" service. Status may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "unavailable" (type Unavailable)
  • "invalid" (type Invalid)
  • "not_found" (type NotFound)
  • error: internal error

type Endpoints

type Endpoints struct {
	Status   goa.Endpoint
	List     goa.Endpoint
	Get      goa.Endpoint
	Start    goa.Endpoint
	Manifest goa.Endpoint
	Chunk    goa.Endpoint
}

Endpoints wraps the "executions" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "executions" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "executions" service endpoints.

type ExecutionCommand

type ExecutionCommand struct {
	// Execution identifier
	ExecutionID string
	// Recording identifier
	RecordingID   string
	Namespace     string
	WorkspaceName string
	WorkspaceUID  *string
	// RFC3339 timestamp
	AdmissionTime *string
	// Storage mode: ephemeral|external|bundled
	Mode *string
	// none|durable
	Durability *string
	// Final command outcome
	Outcome string
	// Final lifecycle state
	State string
	// Guest process exit code when known
	ExitCode *int
	// Standard output, truncated to the pilot output bound
	Stdout []byte
	// Standard error, truncated to the pilot output bound
	Stderr []byte
	// Output was truncated at the 16 KiB bound
	Truncated *bool
	// Guest-measured duration in milliseconds
	DurationMs *uint64
	// Runner denial or transport-loss note
	Denial *string
}

ExecutionCommand is the result type of the executions service start method.

func NewExecutionCommand

func NewExecutionCommand(vres *executionsviews.ExecutionCommand) *ExecutionCommand

NewExecutionCommand initializes result type ExecutionCommand from viewed result type ExecutionCommand.

type ExecutionRecord

type ExecutionRecord struct {
	// Execution identifier
	ExecutionID string
	// Actor identifier
	ActorID *string
	// command|script|shell
	Operation           string
	Namespace           string
	WorkspaceName       string
	WorkspaceUID        *string
	WorkspaceGeneration *int64
	GrantVersion        *string
	OsIdentity          *string
	Elevated            *bool
	RecordingID         string
	// Storage mode: ephemeral|external|bundled
	Mode string
	// none|durable
	Durability string
	Admitted   bool
	// RFC3339 timestamp
	AdmissionTime string
	DenyReason    *string
	// lifecycle state
	State *string
	// RFC3339 timestamp
	StartTime *string
	// RFC3339 timestamp
	EndTime       *string
	ExitCode      *int
	Termination   *string
	RecordingLost *bool
}

ExecutionRecord is the result type of the executions service get method.

func NewExecutionRecord

func NewExecutionRecord(vres *executionsviews.ExecutionRecord) *ExecutionRecord

NewExecutionRecord initializes result type ExecutionRecord from viewed result type ExecutionRecord.

type ExecutionRecordingChunk

type ExecutionRecordingChunk struct {
	// Chunk index starting at 0
	Index uint64
	// Base64-encoded plaintext recording data
	Data []byte
}

ExecutionRecordingChunk is the result type of the executions service chunk method.

type ExecutionRecordingManifest

type ExecutionRecordingManifest struct {
	RecordingID    string
	Chunks         uint64
	PlaintextBytes int64
	Verified       bool
}

ExecutionRecordingManifest is the result type of the executions service manifest method.

type ExecutionScriptPayload added in v0.11.0

type ExecutionScriptPayload struct {
	// Script content
	Body string
	// Optional filename hint (e.g. run.sh, script.ps1)
	Name *string
	// Optional working directory for the script
	Cwd *string
}

Inline script to write to a temp file and execute via shebang

type ExecutionStatus

type ExecutionStatus struct {
	// Whether VM execution is enabled by policy
	Enabled bool
	// Whether elevated execution is allowed by policy
	AllowElevated bool
	// Storage mode: disabled|ephemeral|external|bundled
	StorageMode string
	// Metadata and recordings are durable (not ephemeral)
	Durable bool
	// Store is Ready and can admit work
	StorageAvailable bool
	// Opt-in management issuer prerequisites and initial bootstrap sync are ready;
	// not a guest execution capability
	IssuerReady bool
}

ExecutionStatus is the result type of the executions service status method.

func NewExecutionStatus

func NewExecutionStatus(vres *executionsviews.ExecutionStatus) *ExecutionStatus

NewExecutionStatus initializes result type ExecutionStatus from viewed result type ExecutionStatus.

type Forbidden

type Forbidden string

Scoped execution permission is required

func (Forbidden) Error

func (e Forbidden) Error() string

Error returns an error description.

func (Forbidden) ErrorName deprecated

func (e Forbidden) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Forbidden) GoaErrorName

func (e Forbidden) GoaErrorName() string

GoaErrorName returns the error name.

type GetPayload

type GetPayload struct {
	// Execution identifier
	ExecutionID string
}

GetPayload is the payload type of the executions service get method.

type Invalid

type Invalid string

Invalid management request

func (Invalid) Error

func (e Invalid) Error() string

Error returns an error description.

func (Invalid) ErrorName deprecated

func (e Invalid) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Invalid) GoaErrorName

func (e Invalid) GoaErrorName() string

GoaErrorName returns the error name.

type ListPayload

type ListPayload struct {
	// Filter by namespace
	Namespace *string
	// Filter by workspace name
	WorkspaceName *string
	// Filter by actor
	ActorID *string
	// RFC3339 lower bound
	Since *string
	// Max results
	Limit int
}

ListPayload is the payload type of the executions service list method.

type ManifestPayload

type ManifestPayload struct {
	ExecutionID string
}

ManifestPayload is the payload type of the executions service manifest method.

type NotFound

type NotFound string

Execution not found

func (NotFound) Error

func (e NotFound) Error() string

Error returns an error description.

func (NotFound) ErrorName deprecated

func (e NotFound) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (NotFound) GoaErrorName

func (e NotFound) GoaErrorName() string

GoaErrorName returns the error name.

type Service

type Service interface {
	// Get execution management status (policy + storage readiness)
	Status(context.Context) (res *ExecutionStatus, err error)
	// List execution records visible to the actor
	List(context.Context, *ListPayload) (res []*ExecutionRecord, err error)
	// Get an execution record and its last known outcome
	Get(context.Context, *GetPayload) (res *ExecutionRecord, err error)
	// Execute one bounded root (Linux) or SYSTEM (Windows) command or script in an
	// eligible running agent-equipped VM and return its recorded outcome
	// synchronously
	Start(context.Context, *StartPayload) (res *ExecutionCommand, err error)
	// Verify recording integrity and audit protected playback access
	Manifest(context.Context, *ManifestPayload) (res *ExecutionRecordingManifest, err error)
	// Read a verified recording chunk with fresh scoped recording-read permission
	Chunk(context.Context, *ChunkPayload) (res *ExecutionRecordingChunk, err error)
}

Scoped execution management status, history and protected recording replay

type StartPayload

type StartPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	WorkspaceName string
	// Absolute path or name of the program to run
	Executable *string
	// Arguments passed to the executable verbatim
	Args []string
	// Optional working directory for the new process
	Cwd *string
	// Guest execution deadline in seconds
	DeadlineSeconds int
	// Script to execute (mutually exclusive with executable/args)
	Script *ExecutionScriptPayload
}

StartPayload is the payload type of the executions service start method.

type Unauthorized

type Unauthorized string

A current user-bound credential is required

func (Unauthorized) Error

func (e Unauthorized) Error() string

Error returns an error description.

func (Unauthorized) ErrorName deprecated

func (e Unauthorized) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Unauthorized) GoaErrorName

func (e Unauthorized) GoaErrorName() string

GoaErrorName returns the error name.

type Unavailable

type Unavailable string

Execution storage or policy is unavailable

func (Unavailable) Error

func (e Unavailable) Error() string

Error returns an error description.

func (Unavailable) ErrorName deprecated

func (e Unavailable) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Unavailable) GoaErrorName

func (e Unavailable) GoaErrorName() string

GoaErrorName returns the error name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL