display

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 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 = "display"

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 = [7]string{"capability", "status", "join", "leave", "acquire", "release", "transfer"}

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 NewAcquireEndpoint

func NewAcquireEndpoint(s Service) goa.Endpoint

NewAcquireEndpoint returns an endpoint function that calls the method "acquire" of service "display".

func NewCapabilityEndpoint

func NewCapabilityEndpoint(s Service) goa.Endpoint

NewCapabilityEndpoint returns an endpoint function that calls the method "capability" of service "display".

func NewJoinEndpoint

func NewJoinEndpoint(s Service) goa.Endpoint

NewJoinEndpoint returns an endpoint function that calls the method "join" of service "display".

func NewLeaveEndpoint

func NewLeaveEndpoint(s Service) goa.Endpoint

NewLeaveEndpoint returns an endpoint function that calls the method "leave" of service "display".

func NewReleaseEndpoint

func NewReleaseEndpoint(s Service) goa.Endpoint

NewReleaseEndpoint returns an endpoint function that calls the method "release" of service "display".

func NewStatusEndpoint

func NewStatusEndpoint(s Service) goa.Endpoint

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

func NewTransferEndpoint

func NewTransferEndpoint(s Service) goa.Endpoint

NewTransferEndpoint returns an endpoint function that calls the method "transfer" of service "display".

func NewViewedDisplayCapability

func NewViewedDisplayCapability(res *DisplayCapability, view string) *displayviews.DisplayCapability

NewViewedDisplayCapability initializes viewed result type DisplayCapability from result type DisplayCapability using the given view.

func NewViewedDisplayControl

func NewViewedDisplayControl(res *DisplayControl, view string) *displayviews.DisplayControl

NewViewedDisplayControl initializes viewed result type DisplayControl from result type DisplayControl using the given view.

func NewViewedDisplayJoin

func NewViewedDisplayJoin(res *DisplayJoin, view string) *displayviews.DisplayJoin

NewViewedDisplayJoin initializes viewed result type DisplayJoin from result type DisplayJoin using the given view.

func NewViewedDisplayStatus

func NewViewedDisplayStatus(res *DisplayStatus, view string) *displayviews.DisplayStatus

NewViewedDisplayStatus initializes viewed result type DisplayStatus from result type DisplayStatus using the given view.

Types

type CapabilityPayload

type CapabilityPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	Name string
}

CapabilityPayload is the payload type of the display service capability method.

type Capacity

type Capacity string

The workspace display session is at its participant limit

func (Capacity) Error

func (e Capacity) Error() string

Error returns an error description.

func (Capacity) ErrorName deprecated

func (e Capacity) ErrorName() string

ErrorName returns the error name.

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

func (Capacity) GoaErrorName

func (e Capacity) GoaErrorName() string

GoaErrorName returns the error name.

type Client

type Client struct {
	CapabilityEndpoint goa.Endpoint
	StatusEndpoint     goa.Endpoint
	JoinEndpoint       goa.Endpoint
	LeaveEndpoint      goa.Endpoint
	AcquireEndpoint    goa.Endpoint
	ReleaseEndpoint    goa.Endpoint
	TransferEndpoint   goa.Endpoint
}

Client is the "display" service client.

func NewClient

func NewClient(capability, status, join, leave, acquire, release, transfer goa.Endpoint) *Client

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

func (*Client) Acquire

func (c *Client) Acquire(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)

Acquire calls the "acquire" endpoint of the "display" service. Acquire may return the following errors:

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

func (*Client) Capability

func (c *Client) Capability(ctx context.Context, p *CapabilityPayload) (res *DisplayCapability, err error)

Capability calls the "capability" endpoint of the "display" service. Capability may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Join

func (c *Client) Join(ctx context.Context, p *JoinDisplayPayload) (res *DisplayJoin, err error)

Join calls the "join" endpoint of the "display" service. Join may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • "capacity" (type Capacity)
  • "conflict" (type Conflict)
  • "invalid" (type Invalid)
  • error: internal error

func (*Client) Leave

func (c *Client) Leave(ctx context.Context, p *LeaveDisplayPayload) (res *LeaveResult, err error)

Leave calls the "leave" endpoint of the "display" service. Leave may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Release

func (c *Client) Release(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)

Release calls the "release" endpoint of the "display" service. Release may return the following errors:

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • "conflict" (type Conflict)
  • error: internal error

func (*Client) Status

func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *DisplayStatus, err error)

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

  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Transfer

func (c *Client) Transfer(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)

Transfer calls the "transfer" endpoint of the "display" service. Transfer may return the following errors:

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

type Conflict

type Conflict string

The workspace display is occupied by a controller; join as observer and acquire control explicitly

func (Conflict) Error

func (e Conflict) Error() string

Error returns an error description.

func (Conflict) ErrorName deprecated

func (e Conflict) ErrorName() string

ErrorName returns the error name.

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

func (Conflict) GoaErrorName

func (e Conflict) GoaErrorName() string

GoaErrorName returns the error name.

type DisplayCapability

type DisplayCapability struct {
	// Whether shared display sessions are available for this workspace
	Enabled bool
	// Display protocol/API revision
	Protocol int
	// Supported display transports
	Transports []string
	// Maximum simultaneous participants (controller + observers)
	MaxParticipants *int
	// Maximum advertised guest framebuffer width
	MaxWidth *int
	// Maximum advertised guest framebuffer height
	MaxHeight *int
	// Display stream handshake timeout in milliseconds
	HandshakeTimeoutMs *int
	// Idle membership lifetime in milliseconds
	ParticipantTTLMs *int
	// Current participant count
	Participants *int
	// Whether a controller is currently attached
	ControllerPresent *bool
}

DisplayCapability is the result type of the display service capability method.

func NewDisplayCapability

func NewDisplayCapability(vres *displayviews.DisplayCapability) *DisplayCapability

NewDisplayCapability initializes result type DisplayCapability from viewed result type DisplayCapability.

type DisplayControl

type DisplayControl struct {
	// Controller after the transition, if any
	Controller *Participant
	// Whether a controller was present before the transition
	WasHeld bool
	// True when release cleared the controller
	Released bool
}

DisplayControl is the result type of the display service acquire method.

func NewDisplayControl

func NewDisplayControl(vres *displayviews.DisplayControl) *DisplayControl

NewDisplayControl initializes result type DisplayControl from viewed result type DisplayControl.

type DisplayControlPayload

type DisplayControlPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	Name string
	// Participant performing the transition. Release requires the current
	// controller; acquire may be any participant; transfer requires the current
	// controller
	ParticipantID string
	// Explicit human consent to take or transfer control, demoting the current
	// controller to observer. There is no silent takeover without this
	Force bool
	// Target observer participant identifier for a transfer
	To *string
}

DisplayControlPayload is the payload type of the display service acquire method.

type DisplayJoin

type DisplayJoin struct {
	// The joined participant record
	Participant *Participant
	// Current capability state, including the live participant count
	Capability *DisplayCapability
}

DisplayJoin is the result type of the display service join method.

func NewDisplayJoin

func NewDisplayJoin(vres *displayviews.DisplayJoin) *DisplayJoin

NewDisplayJoin initializes result type DisplayJoin from viewed result type DisplayJoin.

type DisplayStatus

type DisplayStatus struct {
	// Whether shared display sessions are available for this workspace
	Enabled bool
	// Display protocol/API revision
	Protocol int
	// Capture/broker generation. Changes when a new capture owner is elected
	Epoch string
	// Current controller, if any
	Controller *Participant
	// Current observers
	Observers []*Participant
	// Total participant count (controller + observers)
	Participants int
}

DisplayStatus is the result type of the display service status method.

func NewDisplayStatus

func NewDisplayStatus(vres *displayviews.DisplayStatus) *DisplayStatus

NewDisplayStatus initializes result type DisplayStatus from viewed result type DisplayStatus.

type Endpoints

type Endpoints struct {
	Capability goa.Endpoint
	Status     goa.Endpoint
	Join       goa.Endpoint
	Leave      goa.Endpoint
	Acquire    goa.Endpoint
	Release    goa.Endpoint
	Transfer   goa.Endpoint
}

Endpoints wraps the "display" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type Forbidden

type Forbidden string

Editor or admin role with workspace namespace access 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 Invalid

type Invalid string

Invalid join 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 JoinDisplayPayload

type JoinDisplayPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	Name string
	// Initial role. Defaults to observer
	Role string
}

JoinDisplayPayload is the payload type of the display service join method.

type LeaveDisplayPayload

type LeaveDisplayPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	Name string
	// Participant identifier to remove
	ParticipantID string
}

LeaveDisplayPayload is the payload type of the display service leave method.

type LeaveResult

type LeaveResult struct {
	// Whether the participant was removed
	OK bool
}

LeaveResult is the result type of the display service leave method.

type NotFound

type NotFound string

Workspace 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 Participant

type Participant struct {
	// Opaque server-side participant identifier. A capability, not a credential;
	// never sent to the guest or logged
	ID string
	// Current role: observer (view-only) or controller. Server-enforced; a
	// client-side viewOnly flag is not an authorization boundary
	Role string
	// Whether the participant is attached to a display stream
	Connected bool
	// RFC 3339 timestamp when the participant joined
	JoinedAt string
}

A participant in a shared display session

type Service

type Service interface {
	// Advertise whether a workspace participates in shared display sessions and
	// with which limits
	Capability(context.Context, *CapabilityPayload) (res *DisplayCapability, err error)
	// Report live membership and control state of a workspace's shared display
	// session
	Status(context.Context, *StatusPayload) (res *DisplayStatus, err error)
	// Join a workspace's shared display session as an observer or, when free, as
	// the controller
	Join(context.Context, *JoinDisplayPayload) (res *DisplayJoin, err error)
	// Leave a workspace's shared display session, releasing control when the
	// departing participant held it
	Leave(context.Context, *LeaveDisplayPayload) (res *LeaveResult, err error)
	// Acquire control of a workspace's shared display session, demoting the
	// current controller to observer when force is set
	Acquire(context.Context, *DisplayControlPayload) (res *DisplayControl, err error)
	// Release control of a workspace's shared display session, leaving observers
	// attached
	Release(context.Context, *DisplayControlPayload) (res *DisplayControl, err error)
	// Transfer control from the current controller to a named observer, keeping
	// all observers attached
	Transfer(context.Context, *DisplayControlPayload) (res *DisplayControl, err error)
}

Shared display session membership and control: one controller plus view-only observers per VM desktop

type StatusPayload

type StatusPayload struct {
	// Workspace namespace
	Namespace string
	// Workspace name
	Name string
}

StatusPayload is the payload type of the display service status method.

type Unauthorized

type Unauthorized string

Authentication 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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