client

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorKindChangeConflict identifies an operation blocked by another change.
	ErrorKindChangeConflict     = "change-conflict"
	ErrorKindLoginRequired      = "login-required"
	ErrorKindSystemRestart      = "system-restart"
	ErrorKindDaemonRestart      = "daemon-restart"
	ErrorKindNoDefaultServices  = "no-default-services"
	ErrorKindUnsuccessful       = "unsuccessful"
	ErrorKindNoUpdatesAvailable = "no-updates-available"

	// ErrorKindNoWaitingChange identifies an abort or continue request made
	// when no paused change is waiting for the workshop.
	ErrorKindNoWaitingChange = "no-waiting-change-in-progress"
)

Variables

View Source
var ErrNoData = fmt.Errorf("data entry not found")

ErrNoData is returned when there is no data associated with a given key.

View Source
var ErrorNoWaitingChange = errors.New("no waiting change in progress")

ErrorNoWaitingChange signals that an abort or continue request could not be applied because no change is in progress to resume for the workshop. Match it with errors.Is.

Functions

func IsNoUpdatesAvailable

func IsNoUpdatesAvailable(err error) bool

Types

type Action

type Action struct {
	Script string `json:"script"`
}

type Change

type Change struct {
	ID      string  `json:"id"`
	Kind    string  `json:"kind"`
	Summary string  `json:"summary"`
	Status  string  `json:"status"`
	Tasks   []*Task `json:"tasks,omitempty"`
	Ready   bool    `json:"ready"`
	Err     string  `json:"err,omitempty"`

	SpawnTime time.Time `json:"spawn-time,omitempty"`
	ReadyTime time.Time `json:"ready-time,omitempty"`
	// contains filtered or unexported fields
}

Change is a modification to the system state.

func (*Change) Get

func (c *Change) Get(key string, value any) error

Get unmarshals into value the kind-specific data with the provided key.

type ChangeConflictError added in v0.9.2

type ChangeConflictError struct {
	// ChangeID is the ID of the blocking change.
	ChangeID string

	// ChangeKind is the kind of the blocking change, such as "refresh".
	ChangeKind string

	// ProjectID is the ID of the project containing the blocked workshop.
	ProjectID string

	// Workshop is the name of the blocked workshop.
	Workshop string
}

ChangeConflictError describes an operation blocked by another change.

func (ChangeConflictError) Error added in v0.9.2

func (e ChangeConflictError) Error() string

Error returns a human-readable description of the blocking change.

type ChangeSelector

type ChangeSelector uint8

ChangeSelector represents a selection of changes to query for.

const (
	ChangesInProgress ChangeSelector = 1 << iota
	ChangesReady
	ChangesAll = ChangesReady | ChangesInProgress
)

func (ChangeSelector) String

func (c ChangeSelector) String() string

type ChangesOptions

type ChangesOptions struct {
	Workshops   []string // if empty, no filtering by service is done
	ProjectPath string
	Selector    ChangeSelector
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client knows how to talk to the Workshop daemon.

func New

func New(config *Config) (*Client, error)

func (*Client) Abort

func (client *Client) Abort(id string) (*Change, error)

Abort attempts to abort a change that is not yet ready.

func (*Client) Change

func (client *Client) Change(id string, verbose bool) (*Change, error)

Change fetches information about a Change given its ID.

func (*Client) Changes

func (client *Client) Changes(opts *ChangesOptions) ([]*Change, error)

Changes fetches information for the changes specified.

func (*Client) CloseIdleConnections

func (client *Client) CloseIdleConnections()

CloseIdleConnections closes any API connections that are currently unused.

func (*Client) Connect

func (client *Client) Connect(plugProjectId, plugWorkshop, plugSdkName, plugName, slotProjectId, slotWorkshop, slotSdkName, slotName string, opts *DisconnectOptions) (changeID string, err error)

Connects a plug and a slot.

func (*Client) Connections

func (client *Client) Connections(opts *ConnectionOptions) (Connections, error)

Connections returns matching plugs, slots and their connections. Unless specified by matching options, returns established connections.

func (*Client) DebugGet

func (client *Client) DebugGet(action string, result any, params map[string]string) error

DebugGet sends a GET debug action to the server with the provided parameters.

func (*Client) DebugPost

func (client *Client) DebugPost(action string, params any, result any) error

DebugPost sends a POST debug action to the server with the provided parameters.

func (*Client) Disconnect

func (client *Client) Disconnect(plugProjectId, plugWorkshop, plugSdkName, plugName, slotProjectId, slotWorkshop, slotSdkName, slotName string, opts *DisconnectOptions) (changeID string, err error)

Disconnect breaks the connection between a plug and a slot.

func (*Client) Exec

func (client *Client) Exec(opts *ExecOptions, workshop, projectId string) (*ExecProcess, error)

Exec starts a command with the given options, returning a value representing the process.

func (*Client) FindSdks

func (client *Client) FindSdks(q string) ([]SdkSummary, error)

FindSdks searches the SDK Store.

func (*Client) Hijack

func (client *Client) Hijack(f func(*http.Request) (*http.Response, error))

Hijack lets the caller take over the raw HTTP request.

func (*Client) Launch

func (client *Client) Launch(projectId string, names []string, mode string, verbose bool) (changeId string, err error)

func (*Client) List

func (client *Client) List(opts *ListOptions) ([]*WorkshopInfo, []*WorkshopFile, error)

func (*Client) ListActions

func (client *Client) ListActions(projectId, name string) (map[string]Action, error)

func (*Client) Maintenance

func (client *Client) Maintenance() error

Maintenance returns an error reflecting the daemon maintenance status or nil.

func (*Client) Okay

func (client *Client) Okay(t time.Time) error

Okay asks workshopd to chill about the warnings that would have been returned by Warnings at the given time.

func (*Client) Project

func (client *Client) Project(path string) (*Project, error)

func (*Client) Projects

func (client *Client) Projects() ([]Project, error)

func (*Client) Refresh

func (client *Client) Refresh(projectId string, names []string, mode string, option string, verbose bool) (changeId string, err error)

func (*Client) Remount

func (client *Client) Remount(plug *PlugRef, source string) (changeId string, err error)

func (*Client) Remove

func (client *Client) Remove(projectId string, names []string) (changeId string, err error)

func (*Client) Restore

func (client *Client) Restore(projectId string, names []string, verbose bool) (changeId string, err error)

func (*Client) RunWorkshopctl

func (client *Client) RunWorkshopctl(options *WorkshopCtlOptions, stdin io.Reader) (stdout, stderr []byte, err error)

RunWorkshopctl requests a workshopctl run for the given options.

func (*Client) SdkInfo

func (client *Client) SdkInfo(name string) (*SdkFullInfo, error)

SdkInfo retrieves installation details of the given SDK across workshops.

func (*Client) Sdks

func (client *Client) Sdks() ([]SdkVolume, error)

Sdks lists the SDK volumes known to the daemon.

func (*Client) SingleWorkshop

func (client *Client) SingleWorkshop(project *Project) (*Workshop, error)

func (*Client) SingleWorkshopName

func (client *Client) SingleWorkshopName(project *Project) (string, error)

func (*Client) Start

func (client *Client) Start(projectId string, names []string) (changeId string, err error)

func (*Client) Stop

func (client *Client) Stop(projectId string, names []string) (changeId string, err error)

func (*Client) SysInfo

func (client *Client) SysInfo() (*SysInfo, error)

SysInfo gets system information from the remote API.

func (*Client) WaitChange

func (client *Client) WaitChange(id string, opts *WaitChangeOptions) (*Change, error)

WaitChange waits for the change to be finished. If the wait operation succeeds, the returned Change.Err string will be non-empty if the change itself had an error.

func (*Client) Warnings

func (client *Client) Warnings(opts WarningsOptions) ([]*Warning, error)

Warnings returns the list of un-okayed warnings.

func (*Client) WarningsSummary

func (client *Client) WarningsSummary() (count int, timestamp time.Time)

WarningsSummary returns the number of warnings that are ready to be shown to the user, and the timestamp of the most recently added warning (useful for silencing the warning alerts, and OKing the returned warnings).

func (*Client) Workshop

func (client *Client) Workshop(projectId, name string) (*Workshop, error)

type Config

type Config struct {
	// BaseURL contains the base URL where the Workshop daemon is expected to be.
	// It can be empty for a default behavior of talking over a unix socket.
	BaseURL string

	// Socket is the path to the unix socket to use.
	Socket string

	// DisableKeepAlive indicates that the connections should not be kept
	// alive for later reuse (the default is to keep them alive).
	DisableKeepAlive bool

	// UserAgent is the User-Agent header sent to the Workshop daemon.
	UserAgent string

	// RetryInterval is the time to wait between GET retries. Negative
	// values disable retries.
	RetryInterval time.Duration

	// Timeout is the time to spend retrying the request.
	Timeout time.Duration
}

Config allows the user to customize client behavior.

type Connection

type Connection struct {
	Slot      SlotRef `json:"slot"`
	Plug      PlugRef `json:"plug"`
	Interface string  `json:"interface"`
	// Manual is set for connections that were established manually.
	Manual bool `json:"manual"`
	// SlotAttrs is the list of attributes of the slot side of the connection.
	SlotAttrs map[string]any `json:"slot-attrs,omitempty"`
	// PlugAttrs is the list of attributes of the plug side of the connection.
	PlugAttrs map[string]any `json:"plug-attrs,omitempty"`
}

Connection describes a connection between a plug and a slot.

type ConnectionError

type ConnectionError struct {
	// contains filtered or unexported fields
}

ConnectionError represents a connection or communication error.

func (ConnectionError) Error

func (e ConnectionError) Error() string

func (ConnectionError) Unwrap

func (e ConnectionError) Unwrap() error

type ConnectionOptions

type ConnectionOptions struct {
	ProjectId string
	// Workshop selects connections with the workshop on one of the sides, as well
	// as plugs and slots of a given workshop.
	Workshop string
	// Interface selects connections, plugs or slots using given interface.
	Interface string
	// All when true, selects established and undesired connections as well
	// as all disconnected plugs and slots.
	All bool
}

ConnectionOptions contains criteria for selecting matching connections, plugs and slots.

type Connections

type Connections struct {
	// Established is the list of connections that are currently present.
	Established []Connection `json:"established"`
	// Undersired is a list of connections that are manually denied.
	Undesired []Connection `json:"undesired"`
	Plugs     []Plug       `json:"plugs"`
	Slots     []Slot       `json:"slots"`
}

Connections contains information about connections, as well as related plugs and slots.

type DisconnectOptions

type DisconnectOptions struct {
	Forget bool
}

DisconnectOptions represents extra options for disconnect op

type Endpoint

type Endpoint struct {
	Protocol string `json:"protocol"`
	Path     string `json:"path,omitempty"`
	Host     string `json:"host,omitempty"`
	Port     uint16 `json:"port,omitempty"`
}

type Error

type Error struct {
	Kind    string `json:"kind"`
	Value   any    `json:"value"`
	Message string `json:"message"`

	StatusCode int
}

Error is the real value of response.Result when an error occurs.

func (*Error) As added in v0.9.2

func (e *Error) As(target any) bool

As maps generic API errors into richer client-side error types.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is added in v0.9.2

func (e *Error) Is(target error) bool

Is reports whether the error matches a sentinel for the error's kind.

type ExecOptions

type ExecOptions struct {
	// Required: name of the workshop to run the command in
	Workshop string
	// Required: command and arguments (first element is the executable).
	Command []string
	// Optional command prefix prepended by Workshop before execution. If empty,
	// the command is executed without a prefix.
	CommandPrefix []string
	// True to treat command as a workshop action with arguments.
	Action bool

	// Optional environment variables.
	Environment map[string]string

	// Optional working directory (default is /project).
	WorkingDir string

	// Optional user ID and group ID for the process to run as.
	UserId  *int
	GroupId *int

	// Optional timeout for the command execution, after which the process
	// will be terminated. If zero, no timeout applies.
	Timeout time.Duration

	// NOT SUPPORTED: True to ask the server to set up a pseudo-terminal (PTY) for stdout
	// (this also allows window resizing). The default is no PTY, and just
	// to use pipes for stdout/stderr.
	Terminal bool

	// True to use the pseudo-terminal for stdin. The default is to use a pipe
	// for stdin.
	Interactive bool

	// Initial terminal width and height (only apply if Interactive is true).
	// If not specified, the Workshop server uses the target's default (usually
	// 80x25). When using the "workshop exec" CLI, these are set to the host's
	// terminal size automatically.
	Width  int
	Height int

	// Standard input stream. If nil, no input is sent.
	Stdin io.Reader

	// Standard output stream. If nil, output is discarded.
	Stdout io.Writer

	// Standard error stream. If nil, error output is combined with standard
	// output and goes to the Stdout stream.
	Stderr io.Writer
}

type ExecProcess

type ExecProcess struct {
	// contains filtered or unexported fields
}

ExecProcess represents a running process. Use Wait to wait for it to finish.

func (*ExecProcess) SendResize

func (p *ExecProcess) SendResize(width, height int) error

SendResize sends a resize message to the running process.

func (*ExecProcess) SendSignal

func (p *ExecProcess) SendSignal(sig unix.Signal) error

SendSignal sends a signal to the running process.

func (*ExecProcess) Wait

func (p *ExecProcess) Wait() error

Wait waits for the command process to finish. The returned error is nil if the process runs successfully and returns a zero exit code. If the command fails with a nonzero exit code, the error is of type *ExitError.

func (*ExecProcess) WaitStdinDone

func (p *ExecProcess) WaitStdinDone()

WaitStdinDone waits for WebsocketSendStream to be finished calling WriteMessage to avoid a race condition.

type ExitError

type ExitError struct {
	// contains filtered or unexported fields
}

ExitError reports an unsuccessful exit by a command (a nonzero exit code).

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) ExitCode

func (e *ExitError) ExitCode() int

ExitCode returns the command's exit code (it will always be nonzero).

type HealthCheck

type HealthCheck struct {
	Timestamp time.Time `json:"timestamp"`
	Message   string    `json:"message,omitempty"`
	Code      string    `json:"code,omitempty"`
}

type Interface

type Interface struct {
	Name    string `json:"name,omitempty"`
	Summary string `json:"summary,omitempty"`
	DocURL  string `json:"doc-url,omitempty"`
	Plugs   []Plug `json:"plugs,omitempty"`
	Slots   []Slot `json:"slots,omitempty"`
}

Interface holds information about a given interface and its instances.

type InterfaceAction

type InterfaceAction struct {
	Action string `json:"action"`
	Forget bool   `json:"forget,omitempty"`
	Plugs  []Plug `json:"plugs,omitempty"`
	Slots  []Slot `json:"slots,omitempty"`
}

InterfaceAction represents an action performed on the interface system.

type InterfaceOptions

type InterfaceOptions struct {
	Names     []string
	Doc       bool
	Plugs     bool
	Slots     bool
	Connected bool
}

InterfaceOptions represents opt-in elements include in responses.

type ListOptions

type ListOptions struct {
	ProjectId string
}

type Mount

type Mount struct {
	Plug           PlugRef `json:"plug"`
	HostSource     string  `json:"host-source,omitempty"`
	WorkshopSource string  `json:"workshop-source,omitempty"`
	WorkshopTarget string  `json:"workshop-target"`
}

type Plug

type Plug struct {
	ProjectId   string         `json:"project-id"`
	Workshop    string         `json:"workshop"`
	Sdk         string         `json:"sdk"`
	Name        string         `json:"plug"`
	Interface   string         `json:"interface,omitempty"`
	Attrs       map[string]any `json:"attrs,omitempty"`
	Label       string         `json:"label,omitempty"`
	Bind        *PlugRef       `json:"bind,omitempty"`
	Connections []SlotRef      `json:"connections,omitempty"`
}

Plug represents the potential of a given snap to connect to a slot.

func (*Plug) Ref

func (p *Plug) Ref() PlugRef

type PlugRef

type PlugRef struct {
	ProjectId string `json:"project-id"`
	Workshop  string `json:"workshop"`
	Sdk       string `json:"sdk"`
	Name      string `json:"plug"`
}

PlugRef is a reference to a plug.

func ParseShortPlugRef

func ParseShortPlugRef(plug string) (*PlugRef, error)

type Project

type Project struct {
	Id   string `json:"id"`
	Path string `json:"path"`
}

type Remount

type Remount struct {
	Action     string   `json:"action"`
	Plug       *PlugRef `json:"plug"`
	HostSource string   `json:"host-source"`
}

type RequestError

type RequestError struct {
	// contains filtered or unexported fields
}

RequestError is returned when there's an error processing the request.

func (RequestError) Error

func (e RequestError) Error() string

type ResultInfo

type ResultInfo struct{}

ResultInfo is empty for now, but this is the mechanism that conveys general information that makes sense to requests at a more general level, and might be disconnected from the specific request at hand.

type Sdk

type Sdk struct {
	Name        string       `json:"name"`
	Version     string       `json:"version,omitempty"`
	Channel     string       `json:"channel"`
	Source      string       `json:"source"`
	Revision    string       `json:"revision"`
	BuiltAt     time.Time    `json:"built-at"`
	InstalledAt time.Time    `json:"installed-at"`
	Health      *HealthCheck `json:"health-check,omitempty"`
	Mounts      []*Mount     `json:"mounts,omitempty"`
	Tunnels     []*Tunnel    `json:"tunnels,omitempty"`
}

type SdkFullInfo

type SdkFullInfo struct {
	Name        string         `json:"name"`
	PackageID   string         `json:"package-id,omitempty"`
	Title       string         `json:"title,omitempty"`
	Summary     string         `json:"summary,omitempty"`
	Description string         `json:"description,omitempty"`
	License     string         `json:"license,omitempty"`
	Website     string         `json:"website,omitempty"`
	Publisher   *StoreAccount  `json:"publisher,omitempty"`
	Channels    []*SdkRevision `json:"channels,omitempty"`
	Installed   []SdkInstalled `json:"installed,omitempty"`
}

type SdkInstalled

type SdkInstalled struct {
	ProjectPath string `json:"project-path"`
	Workshop    string `json:"workshop"`
	Channel     string `json:"channel,omitempty"`
	Base        string `json:"base,omitempty"`
	Arch        string `json:"architecture,omitempty"`
	SdkVolume
}

type SdkRevision

type SdkRevision struct {
	Channel      string     `json:"channel"`
	Track        string     `json:"track"`
	Risk         string     `json:"risk"`
	Revision     string     `json:"revision"`
	BuiltAt      *time.Time `json:"built-at,omitempty"`
	UploadedAt   *time.Time `json:"uploaded-at,omitempty"`
	ReleasedAt   *time.Time `json:"released-at,omitempty"`
	Version      string     `json:"version,omitempty"`
	Base         string     `json:"base,omitempty"`
	Arch         string     `json:"arch,omitempty"`
	DownloadSize uint64     `json:"download-size,omitzero"`
}

type SdkSummary

type SdkSummary struct {
	Name        string        `json:"name"`
	PackageID   string        `json:"package-id,omitempty"`
	Summary     string        `json:"summary,omitempty"`
	Description string        `json:"description,omitempty"`
	License     string        `json:"license,omitempty"`
	Publisher   *StoreAccount `json:"publisher,omitempty"`
	Channel     string        `json:"channel"`
	Track       string        `json:"track"`
	Risk        string        `json:"risk"`
	Revision    string        `json:"revision"`
	ReleasedAt  *time.Time    `json:"released-at,omitempty"`
	Version     string        `json:"version,omitempty"`
	Base        string        `json:"base,omitempty"`
	Arch        string        `json:"arch,omitempty"`
}

type SdkVolume

type SdkVolume struct {
	Name     string     `json:"name"`
	Version  string     `json:"version,omitempty"`
	Revision string     `json:"revision"`
	BuiltAt  *time.Time `json:"built-at,omitempty"`
	Size     uint64     `json:"size,omitempty"`
}

SdkVolume represents SDK volume summary returned by the daemon.

type SingleWorkshopError

type SingleWorkshopError struct {
	Project string
	Names   []string
}

func (*SingleWorkshopError) Error

func (e *SingleWorkshopError) Error() string

type Slot

type Slot struct {
	ProjectId   string         `json:"project-id"`
	Workshop    string         `json:"workshop"`
	Sdk         string         `json:"sdk"`
	Name        string         `json:"slot"`
	Interface   string         `json:"interface,omitempty"`
	Attrs       map[string]any `json:"attrs,omitempty"`
	Label       string         `json:"label,omitempty"`
	Connections []PlugRef      `json:"connections,omitempty"`
}

Slot represents a capacity offered by a snap.

type SlotRef

type SlotRef struct {
	ProjectId string `json:"project-id"`
	Workshop  string `json:"workshop"`
	Sdk       string `json:"sdk"`
	Name      string `json:"slot"`
}

SlotRef is a reference to a slot.

func ParseShortSlotRef

func ParseShortSlotRef(slot string) (*SlotRef, error)

Uses the plug parsing function as the formats are identical. This should change when/if go will enable individual fields access for generic types which would allow to have one generic function returning plug or slot reference type on request.

func ParseSlotSdkRef

func ParseSlotSdkRef(slot string) (*SlotRef, error)

type SocketNotFoundError

type SocketNotFoundError struct {
	// Err is the wrapped error.
	Err error

	// Path is the path of the non-existent socket.
	Path string
}

SocketNotFoundError is the error type returned when the client fails to find a unix socket at the specified path.

func (SocketNotFoundError) Error

func (s SocketNotFoundError) Error() string

func (SocketNotFoundError) Unwrap

func (s SocketNotFoundError) Unwrap() error

type StoreAccount

type StoreAccount struct {
	ID          string `json:"id"`
	Username    string `json:"username"`
	DisplayName string `json:"display-name"`
	Validation  string `json:"validation,omitempty"`
}

type SysInfo

type SysInfo struct {
	// Version is the server version.
	Version string `json:"version,omitempty"`

	// BootID is a unique string that represents this boot of the server.
	BootID string `json:"boot-id,omitempty"`
}

type Task

type Task struct {
	ID       string       `json:"id"`
	Kind     string       `json:"kind"`
	Summary  string       `json:"summary"`
	Status   string       `json:"status"`
	Log      []string     `json:"log,omitempty"`
	Progress TaskProgress `json:"progress"`

	SpawnTime time.Time     `json:"spawn-time,omitempty"`
	ReadyTime time.Time     `json:"ready-time,omitempty"`
	DoingTime time.Duration `json:"doing-time,omitempty"`

	Data map[string]*json.RawMessage
}

Task represents a single operation done to change the system's state.

func (*Task) Get

func (t *Task) Get(key string, value any) error

Get unmarshals into value the kind-specific data with the provided key.

type TaskProgress

type TaskProgress struct {
	Label string `json:"label"`
	Done  int    `json:"done"`
	Total int    `json:"total"`
}

TaskProgress represents the completion progress of a task.

type Tunnel

type Tunnel struct {
	Plug PlugRef  `json:"plug"`
	From Endpoint `json:"from"`
	To   Endpoint `json:"to"`
}

type WaitChangeOptions

type WaitChangeOptions struct {
	// If nonzero, wait at most this long before returning. If a timeout
	// occurs, WaitChange will return an error.
	Timeout time.Duration
}

type Warning

type Warning struct {
	Message     string        `json:"message"`
	FirstAdded  time.Time     `json:"first-added"`
	LastAdded   time.Time     `json:"last-added"`
	LastShown   time.Time     `json:"last-shown,omitempty"`
	ExpireAfter time.Duration `json:"expire-after,omitempty"`
	RepeatAfter time.Duration `json:"repeat-after,omitempty"`
}

A Warning is a short messages that's meant to alert about system events. There'll only ever be one Warning with the same message, and it can be silenced for a while before repeating. After a (supposedly longer) while it'll go away on its own (unless it recurrs).

type WarningsOptions

type WarningsOptions struct {
	All bool
}

WarningsOptions contains options for querying workshopd for warnings supported options: - All: return all warnings, instead of only the un-okayed ones.

type Workshop

type Workshop struct {
	WorkshopInfo
	Path string `json:"path"`
}

type WorkshopActionOptions

type WorkshopActionOptions struct {
	Mode string `json:"mode,omitempty"`
	// Supported refresh options: "update", "restore".
	RefreshOption string `json:"refresh-option,omitempty"`
	Verbose       bool   `json:"verbose,omitzero"`
}

type WorkshopActionSetup

type WorkshopActionSetup struct {
	Action  string
	Names   []string
	Options *WorkshopActionOptions
}

type WorkshopCtlOptions

type WorkshopCtlOptions struct {
	// ContextID is a string used to determine the context of this call (e.g.
	// which context and handler should be used, etc.)
	ContextID string `json:"context-id"`

	// Args contains a list of parameters to use for this invocation.
	Args []string `json:"args"`
}

WorkshopCtlOptions holds the various options with which workshopctl is invoked.

type WorkshopCtlPostData

type WorkshopCtlPostData struct {
	WorkshopCtlOptions

	Stdin []byte `json:"stdin,omitempty"`
}

WorkshopCtlPostData is the data posted to the daemon /v2/workshopctl endpoint TODO: this can be removed again once we no longer need to pass stdin data but instead use a real stdin stream

type WorkshopFile

type WorkshopFile struct {
	ProjectId string `json:"project-id"`
	Name      string `json:"name"`
	Path      string `json:"path"`
}

type WorkshopInfo

type WorkshopInfo struct {
	ProjectId string   `json:"project-id"`
	Name      string   `json:"name"`
	Base      string   `json:"base"`
	Status    string   `json:"status"`
	Sdks      []*Sdk   `json:"sdks,omitempty"`
	Hostname  string   `json:"hostname,omitempty"`
	Notes     []string `json:"notes,omitempty"`
}

type Workshops

type Workshops struct {
	Workshops []*WorkshopInfo `json:"workshops"`
	Files     []*WorkshopFile `json:"files"`
}

Jump to

Keyboard shortcuts

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