Documentation
¶
Index ¶
- Constants
- Variables
- func NewAcquireEndpoint(s Service) goa.Endpoint
- func NewCapabilityEndpoint(s Service) goa.Endpoint
- func NewJoinEndpoint(s Service) goa.Endpoint
- func NewLeaveEndpoint(s Service) goa.Endpoint
- func NewReleaseEndpoint(s Service) goa.Endpoint
- func NewStatusEndpoint(s Service) goa.Endpoint
- func NewTransferEndpoint(s Service) goa.Endpoint
- func NewViewedDisplayCapability(res *DisplayCapability, view string) *displayviews.DisplayCapability
- func NewViewedDisplayControl(res *DisplayControl, view string) *displayviews.DisplayControl
- func NewViewedDisplayJoin(res *DisplayJoin, view string) *displayviews.DisplayJoin
- func NewViewedDisplayStatus(res *DisplayStatus, view string) *displayviews.DisplayStatus
- type CapabilityPayload
- type Capacity
- type Client
- func (c *Client) Acquire(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)
- func (c *Client) Capability(ctx context.Context, p *CapabilityPayload) (res *DisplayCapability, err error)
- func (c *Client) Join(ctx context.Context, p *JoinDisplayPayload) (res *DisplayJoin, err error)
- func (c *Client) Leave(ctx context.Context, p *LeaveDisplayPayload) (res *LeaveResult, err error)
- func (c *Client) Release(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)
- func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *DisplayStatus, err error)
- func (c *Client) Transfer(ctx context.Context, p *DisplayControlPayload) (res *DisplayControl, err error)
- type Conflict
- type DisplayCapability
- type DisplayControl
- type DisplayControlPayload
- type DisplayJoin
- type DisplayStatus
- type Endpoints
- type Forbidden
- type Invalid
- type JoinDisplayPayload
- type LeaveDisplayPayload
- type LeaveResult
- type NotFound
- type Participant
- type Service
- type StatusPayload
- type Unauthorized
Constants ¶
const APIName = "kube-workspaces"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0.0"
APIVersion is the version of the API as defined in the design.
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 ¶
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 ¶
NewAcquireEndpoint returns an endpoint function that calls the method "acquire" of service "display".
func NewCapabilityEndpoint ¶
NewCapabilityEndpoint returns an endpoint function that calls the method "capability" of service "display".
func NewJoinEndpoint ¶
NewJoinEndpoint returns an endpoint function that calls the method "join" of service "display".
func NewLeaveEndpoint ¶
NewLeaveEndpoint returns an endpoint function that calls the method "leave" of service "display".
func NewReleaseEndpoint ¶
NewReleaseEndpoint returns an endpoint function that calls the method "release" of service "display".
func NewStatusEndpoint ¶
NewStatusEndpoint returns an endpoint function that calls the method "status" of service "display".
func NewTransferEndpoint ¶
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) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Capacity) GoaErrorName ¶
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 (*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) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Conflict) GoaErrorName ¶
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 ¶
NewEndpoints wraps the methods of the "display" service with endpoints.
type Forbidden ¶
type Forbidden string
Editor or admin role with workspace namespace access is required
func (Forbidden) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Forbidden) GoaErrorName ¶
GoaErrorName returns the error name.
type Invalid ¶
type Invalid string
Invalid join request
func (Invalid) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Invalid) GoaErrorName ¶
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) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (NotFound) GoaErrorName ¶
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 ¶
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.