server

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireDisplayPath

func AcquireDisplayPath(name string) string

AcquireDisplayPath returns the URL path to the display service acquire HTTP endpoint.

func CapabilityDisplayPath

func CapabilityDisplayPath(name string) string

CapabilityDisplayPath returns the URL path to the display service capability HTTP endpoint.

func DecodeAcquireRequest

func DecodeAcquireRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.DisplayControlPayload, error)

DecodeAcquireRequest returns a decoder for requests sent to the display acquire endpoint.

func DecodeCapabilityRequest

func DecodeCapabilityRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.CapabilityPayload, error)

DecodeCapabilityRequest returns a decoder for requests sent to the display capability endpoint.

func DecodeJoinRequest

func DecodeJoinRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.JoinDisplayPayload, error)

DecodeJoinRequest returns a decoder for requests sent to the display join endpoint.

func DecodeLeaveRequest

func DecodeLeaveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.LeaveDisplayPayload, error)

DecodeLeaveRequest returns a decoder for requests sent to the display leave endpoint.

func DecodeReleaseRequest

func DecodeReleaseRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.DisplayControlPayload, error)

DecodeReleaseRequest returns a decoder for requests sent to the display release endpoint.

func DecodeStatusRequest

func DecodeStatusRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.StatusPayload, error)

DecodeStatusRequest returns a decoder for requests sent to the display status endpoint.

func DecodeTransferRequest

func DecodeTransferRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*display.DisplayControlPayload, error)

DecodeTransferRequest returns a decoder for requests sent to the display transfer endpoint.

func EncodeAcquireError

func EncodeAcquireError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeAcquireError returns an encoder for errors returned by the acquire display endpoint.

func EncodeAcquireResponse

func EncodeAcquireResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeAcquireResponse returns an encoder for responses returned by the display acquire endpoint.

func EncodeCapabilityError

func EncodeCapabilityError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeCapabilityError returns an encoder for errors returned by the capability display endpoint.

func EncodeCapabilityResponse

func EncodeCapabilityResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeCapabilityResponse returns an encoder for responses returned by the display capability endpoint.

func EncodeJoinError

func EncodeJoinError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeJoinError returns an encoder for errors returned by the join display endpoint.

func EncodeJoinResponse

func EncodeJoinResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeJoinResponse returns an encoder for responses returned by the display join endpoint.

func EncodeLeaveError

func EncodeLeaveError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeLeaveError returns an encoder for errors returned by the leave display endpoint.

func EncodeLeaveResponse

func EncodeLeaveResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeLeaveResponse returns an encoder for responses returned by the display leave endpoint.

func EncodeReleaseError

func EncodeReleaseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeReleaseError returns an encoder for errors returned by the release display endpoint.

func EncodeReleaseResponse

func EncodeReleaseResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeReleaseResponse returns an encoder for responses returned by the display release endpoint.

func EncodeStatusError

func EncodeStatusError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeStatusError returns an encoder for errors returned by the status display endpoint.

func EncodeStatusResponse

func EncodeStatusResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeStatusResponse returns an encoder for responses returned by the display status endpoint.

func EncodeTransferError

func EncodeTransferError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeTransferError returns an encoder for errors returned by the transfer display endpoint.

func EncodeTransferResponse

func EncodeTransferResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeTransferResponse returns an encoder for responses returned by the display transfer endpoint.

func JoinDisplayPath

func JoinDisplayPath(name string) string

JoinDisplayPath returns the URL path to the display service join HTTP endpoint.

func LeaveDisplayPath

func LeaveDisplayPath(name string, participantID string) string

LeaveDisplayPath returns the URL path to the display service leave HTTP endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the display endpoints.

func MountAcquireHandler

func MountAcquireHandler(mux goahttp.Muxer, h http.Handler)

MountAcquireHandler configures the mux to serve the "display" service "acquire" endpoint.

func MountCapabilityHandler

func MountCapabilityHandler(mux goahttp.Muxer, h http.Handler)

MountCapabilityHandler configures the mux to serve the "display" service "capability" endpoint.

func MountJoinHandler

func MountJoinHandler(mux goahttp.Muxer, h http.Handler)

MountJoinHandler configures the mux to serve the "display" service "join" endpoint.

func MountLeaveHandler

func MountLeaveHandler(mux goahttp.Muxer, h http.Handler)

MountLeaveHandler configures the mux to serve the "display" service "leave" endpoint.

func MountReleaseHandler

func MountReleaseHandler(mux goahttp.Muxer, h http.Handler)

MountReleaseHandler configures the mux to serve the "display" service "release" endpoint.

func MountStatusHandler

func MountStatusHandler(mux goahttp.Muxer, h http.Handler)

MountStatusHandler configures the mux to serve the "display" service "status" endpoint.

func MountTransferHandler

func MountTransferHandler(mux goahttp.Muxer, h http.Handler)

MountTransferHandler configures the mux to serve the "display" service "transfer" endpoint.

func NewAcquireDisplayControlPayload

func NewAcquireDisplayControlPayload(body *AcquireRequestBody, name string, namespace string) *display.DisplayControlPayload

NewAcquireDisplayControlPayload builds a display service acquire endpoint payload.

func NewAcquireHandler

func NewAcquireHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewAcquireHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "acquire" endpoint.

func NewCapabilityHandler

func NewCapabilityHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewCapabilityHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "capability" endpoint.

func NewCapabilityPayload

func NewCapabilityPayload(name string, namespace string) *display.CapabilityPayload

NewCapabilityPayload builds a display service capability endpoint payload.

func NewJoinDisplayPayload

func NewJoinDisplayPayload(body *JoinRequestBody, name string, namespace string) *display.JoinDisplayPayload

NewJoinDisplayPayload builds a display service join endpoint payload.

func NewJoinHandler

func NewJoinHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewJoinHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "join" endpoint.

func NewLeaveDisplayPayload

func NewLeaveDisplayPayload(name string, participantID string, namespace string) *display.LeaveDisplayPayload

NewLeaveDisplayPayload builds a display service leave endpoint payload.

func NewLeaveHandler

func NewLeaveHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewLeaveHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "leave" endpoint.

func NewReleaseDisplayControlPayload

func NewReleaseDisplayControlPayload(body *ReleaseRequestBody, name string, namespace string) *display.DisplayControlPayload

NewReleaseDisplayControlPayload builds a display service release endpoint payload.

func NewReleaseHandler

func NewReleaseHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewReleaseHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "release" endpoint.

func NewStatusHandler

func NewStatusHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewStatusHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "status" endpoint.

func NewStatusPayload

func NewStatusPayload(name string, namespace string) *display.StatusPayload

NewStatusPayload builds a display service status endpoint payload.

func NewTransferDisplayControlPayload

func NewTransferDisplayControlPayload(body *TransferRequestBody, name string, namespace string) *display.DisplayControlPayload

NewTransferDisplayControlPayload builds a display service transfer endpoint payload.

func NewTransferHandler

func NewTransferHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewTransferHandler creates a HTTP handler which loads the HTTP request and calls the "display" service "transfer" endpoint.

func ReleaseDisplayPath

func ReleaseDisplayPath(name string) string

ReleaseDisplayPath returns the URL path to the display service release HTTP endpoint.

func StatusDisplayPath

func StatusDisplayPath(name string) string

StatusDisplayPath returns the URL path to the display service status HTTP endpoint.

func TransferDisplayPath

func TransferDisplayPath(name string) string

TransferDisplayPath returns the URL path to the display service transfer HTTP endpoint.

func ValidateAcquireRequestBody

func ValidateAcquireRequestBody(body *AcquireRequestBody) (err error)

ValidateAcquireRequestBody runs the validations defined on AcquireRequestBody

func ValidateJoinRequestBody

func ValidateJoinRequestBody(body *JoinRequestBody) (err error)

ValidateJoinRequestBody runs the validations defined on JoinRequestBody

func ValidateReleaseRequestBody

func ValidateReleaseRequestBody(body *ReleaseRequestBody) (err error)

ValidateReleaseRequestBody runs the validations defined on ReleaseRequestBody

func ValidateTransferRequestBody

func ValidateTransferRequestBody(body *TransferRequestBody) (err error)

ValidateTransferRequestBody runs the validations defined on TransferRequestBody

Types

type AcquireRequestBody

type AcquireRequestBody struct {
	// Participant performing the transition. Release requires the current
	// controller; acquire may be any participant; transfer requires the current
	// controller
	ParticipantID *string `form:"participant_id,omitempty" json:"participant_id,omitempty" xml:"participant_id,omitempty"`
	// Explicit human consent to take or transfer control, demoting the current
	// controller to observer. There is no silent takeover without this
	Force *bool `form:"force,omitempty" json:"force,omitempty" xml:"force,omitempty"`
	// Target observer participant identifier for a transfer
	To *string `form:"to,omitempty" json:"to,omitempty" xml:"to,omitempty"`
}

AcquireRequestBody is the type of the "display" service "acquire" endpoint HTTP request body.

type AcquireResponseBody

type AcquireResponseBody struct {
	// Controller after the transition, if any
	Controller *ParticipantResponseBody `form:"controller,omitempty" json:"controller,omitempty" xml:"controller,omitempty"`
	// Whether a controller was present before the transition
	WasHeld bool `form:"was_held" json:"was_held" xml:"was_held"`
	// True when release cleared the controller
	Released bool `form:"released" json:"released" xml:"released"`
}

AcquireResponseBody is the type of the "display" service "acquire" endpoint HTTP response body.

func NewAcquireResponseBody

func NewAcquireResponseBody(res *displayviews.DisplayControlView) *AcquireResponseBody

NewAcquireResponseBody builds the HTTP response body from the result of the "acquire" endpoint of the "display" service.

type CapabilityResponseBody

type CapabilityResponseBody struct {
	// Whether shared display sessions are available for this workspace
	Enabled bool `form:"enabled" json:"enabled" xml:"enabled"`
	// Display protocol/API revision
	Protocol int `form:"protocol" json:"protocol" xml:"protocol"`
	// Supported display transports
	Transports []string `form:"transports,omitempty" json:"transports,omitempty" xml:"transports,omitempty"`
	// Maximum simultaneous participants (controller + observers)
	MaxParticipants *int `form:"max_participants,omitempty" json:"max_participants,omitempty" xml:"max_participants,omitempty"`
	// Maximum advertised guest framebuffer width
	MaxWidth *int `form:"max_width,omitempty" json:"max_width,omitempty" xml:"max_width,omitempty"`
	// Maximum advertised guest framebuffer height
	MaxHeight *int `form:"max_height,omitempty" json:"max_height,omitempty" xml:"max_height,omitempty"`
	// Display stream handshake timeout in milliseconds
	HandshakeTimeoutMs *int `form:"handshake_timeout_ms,omitempty" json:"handshake_timeout_ms,omitempty" xml:"handshake_timeout_ms,omitempty"`
	// Idle membership lifetime in milliseconds
	ParticipantTTLMs *int `form:"participant_ttl_ms,omitempty" json:"participant_ttl_ms,omitempty" xml:"participant_ttl_ms,omitempty"`
	// Current participant count
	Participants *int `form:"participants,omitempty" json:"participants,omitempty" xml:"participants,omitempty"`
	// Whether a controller is currently attached
	ControllerPresent *bool `form:"controller_present,omitempty" json:"controller_present,omitempty" xml:"controller_present,omitempty"`
}

CapabilityResponseBody is the type of the "display" service "capability" endpoint HTTP response body.

func NewCapabilityResponseBody

func NewCapabilityResponseBody(res *displayviews.DisplayCapabilityView) *CapabilityResponseBody

NewCapabilityResponseBody builds the HTTP response body from the result of the "capability" endpoint of the "display" service.

type DisplayCapabilityResponseBody

type DisplayCapabilityResponseBody struct {
	// Whether shared display sessions are available for this workspace
	Enabled bool `form:"enabled" json:"enabled" xml:"enabled"`
	// Display protocol/API revision
	Protocol int `form:"protocol" json:"protocol" xml:"protocol"`
	// Supported display transports
	Transports []string `form:"transports,omitempty" json:"transports,omitempty" xml:"transports,omitempty"`
	// Maximum simultaneous participants (controller + observers)
	MaxParticipants *int `form:"max_participants,omitempty" json:"max_participants,omitempty" xml:"max_participants,omitempty"`
	// Maximum advertised guest framebuffer width
	MaxWidth *int `form:"max_width,omitempty" json:"max_width,omitempty" xml:"max_width,omitempty"`
	// Maximum advertised guest framebuffer height
	MaxHeight *int `form:"max_height,omitempty" json:"max_height,omitempty" xml:"max_height,omitempty"`
	// Display stream handshake timeout in milliseconds
	HandshakeTimeoutMs *int `form:"handshake_timeout_ms,omitempty" json:"handshake_timeout_ms,omitempty" xml:"handshake_timeout_ms,omitempty"`
	// Idle membership lifetime in milliseconds
	ParticipantTTLMs *int `form:"participant_ttl_ms,omitempty" json:"participant_ttl_ms,omitempty" xml:"participant_ttl_ms,omitempty"`
	// Current participant count
	Participants *int `form:"participants,omitempty" json:"participants,omitempty" xml:"participants,omitempty"`
	// Whether a controller is currently attached
	ControllerPresent *bool `form:"controller_present,omitempty" json:"controller_present,omitempty" xml:"controller_present,omitempty"`
}

DisplayCapabilityResponseBody is used to define fields on response body types.

type JoinRequestBody

type JoinRequestBody struct {
	// Initial role. Defaults to observer
	Role *string `form:"role,omitempty" json:"role,omitempty" xml:"role,omitempty"`
}

JoinRequestBody is the type of the "display" service "join" endpoint HTTP request body.

type JoinResponseBody

type JoinResponseBody struct {
	// The joined participant record
	Participant *ParticipantResponseBody `form:"participant" json:"participant" xml:"participant"`
	// Current capability state, including the live participant count
	Capability *DisplayCapabilityResponseBody `form:"capability,omitempty" json:"capability,omitempty" xml:"capability,omitempty"`
}

JoinResponseBody is the type of the "display" service "join" endpoint HTTP response body.

func NewJoinResponseBody

func NewJoinResponseBody(res *displayviews.DisplayJoinView) *JoinResponseBody

NewJoinResponseBody builds the HTTP response body from the result of the "join" endpoint of the "display" service.

type LeaveResponseBody

type LeaveResponseBody struct {
	// Whether the participant was removed
	OK bool `form:"ok" json:"ok" xml:"ok"`
}

LeaveResponseBody is the type of the "display" service "leave" endpoint HTTP response body.

func NewLeaveResponseBody

func NewLeaveResponseBody(res *display.LeaveResult) *LeaveResponseBody

NewLeaveResponseBody builds the HTTP response body from the result of the "leave" endpoint of the "display" service.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type ParticipantResponseBody

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

ParticipantResponseBody is used to define fields on response body types.

type ReleaseRequestBody

type ReleaseRequestBody struct {
	// Participant performing the transition. Release requires the current
	// controller; acquire may be any participant; transfer requires the current
	// controller
	ParticipantID *string `form:"participant_id,omitempty" json:"participant_id,omitempty" xml:"participant_id,omitempty"`
	// Explicit human consent to take or transfer control, demoting the current
	// controller to observer. There is no silent takeover without this
	Force *bool `form:"force,omitempty" json:"force,omitempty" xml:"force,omitempty"`
	// Target observer participant identifier for a transfer
	To *string `form:"to,omitempty" json:"to,omitempty" xml:"to,omitempty"`
}

ReleaseRequestBody is the type of the "display" service "release" endpoint HTTP request body.

type ReleaseResponseBody

type ReleaseResponseBody struct {
	// Controller after the transition, if any
	Controller *ParticipantResponseBody `form:"controller,omitempty" json:"controller,omitempty" xml:"controller,omitempty"`
	// Whether a controller was present before the transition
	WasHeld bool `form:"was_held" json:"was_held" xml:"was_held"`
	// True when release cleared the controller
	Released bool `form:"released" json:"released" xml:"released"`
}

ReleaseResponseBody is the type of the "display" service "release" endpoint HTTP response body.

func NewReleaseResponseBody

func NewReleaseResponseBody(res *displayviews.DisplayControlView) *ReleaseResponseBody

NewReleaseResponseBody builds the HTTP response body from the result of the "release" endpoint of the "display" service.

type Server

type Server struct {
	Mounts     []*MountPoint
	Capability http.Handler
	Status     http.Handler
	Join       http.Handler
	Leave      http.Handler
	Acquire    http.Handler
	Release    http.Handler
	Transfer   http.Handler
}

Server lists the display service endpoint HTTP handlers.

func New

func New(
	e *display.Endpoints,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the display service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.

func (*Server) MethodNames

func (s *Server) MethodNames() []string

MethodNames returns the methods served.

func (*Server) Mount

func (s *Server) Mount(mux goahttp.Muxer)

Mount configures the mux to serve the display endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type StatusResponseBody

type StatusResponseBody struct {
	// Whether shared display sessions are available for this workspace
	Enabled bool `form:"enabled" json:"enabled" xml:"enabled"`
	// Display protocol/API revision
	Protocol int `form:"protocol" json:"protocol" xml:"protocol"`
	// Capture/broker generation. Changes when a new capture owner is elected
	Epoch string `form:"epoch" json:"epoch" xml:"epoch"`
	// Current controller, if any
	Controller *ParticipantResponseBody `form:"controller,omitempty" json:"controller,omitempty" xml:"controller,omitempty"`
	// Current observers
	Observers []*ParticipantResponseBody `form:"observers,omitempty" json:"observers,omitempty" xml:"observers,omitempty"`
	// Total participant count (controller + observers)
	Participants int `form:"participants" json:"participants" xml:"participants"`
}

StatusResponseBody is the type of the "display" service "status" endpoint HTTP response body.

func NewStatusResponseBody

func NewStatusResponseBody(res *displayviews.DisplayStatusView) *StatusResponseBody

NewStatusResponseBody builds the HTTP response body from the result of the "status" endpoint of the "display" service.

type TransferRequestBody

type TransferRequestBody struct {
	// Participant performing the transition. Release requires the current
	// controller; acquire may be any participant; transfer requires the current
	// controller
	ParticipantID *string `form:"participant_id,omitempty" json:"participant_id,omitempty" xml:"participant_id,omitempty"`
	// Explicit human consent to take or transfer control, demoting the current
	// controller to observer. There is no silent takeover without this
	Force *bool `form:"force,omitempty" json:"force,omitempty" xml:"force,omitempty"`
	// Target observer participant identifier for a transfer
	To *string `form:"to,omitempty" json:"to,omitempty" xml:"to,omitempty"`
}

TransferRequestBody is the type of the "display" service "transfer" endpoint HTTP request body.

type TransferResponseBody

type TransferResponseBody struct {
	// Controller after the transition, if any
	Controller *ParticipantResponseBody `form:"controller,omitempty" json:"controller,omitempty" xml:"controller,omitempty"`
	// Whether a controller was present before the transition
	WasHeld bool `form:"was_held" json:"was_held" xml:"was_held"`
	// True when release cleared the controller
	Released bool `form:"released" json:"released" xml:"released"`
}

TransferResponseBody is the type of the "display" service "transfer" endpoint HTTP response body.

func NewTransferResponseBody

func NewTransferResponseBody(res *displayviews.DisplayControlView) *TransferResponseBody

NewTransferResponseBody builds the HTTP response body from the result of the "transfer" endpoint of the "display" service.

Jump to

Keyboard shortcuts

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