Documentation
¶
Index ¶
- Constants
- Variables
- func NewAttachEndpoint(s Service) goa.Endpoint
- func NewReleaseEndpoint(s Service) goa.Endpoint
- func NewRenewEndpoint(s Service) goa.Endpoint
- func NewStatusEndpoint(s Service) goa.Endpoint
- func NewViewedAgentRelease(res *AgentRelease, view string) *agentviews.AgentRelease
- func NewViewedAgentRenew(res *AgentRenew, view string) *agentviews.AgentRenew
- func NewViewedAgentStatus(res *AgentStatus, view string) *agentviews.AgentStatus
- func NewViewedAgentTicket(res *AgentTicket, view string) *agentviews.AgentTicket
- type AgentAttachPayload
- type AgentRelease
- type AgentRenew
- type AgentStatus
- type AgentTicket
- type Client
- func (c *Client) Attach(ctx context.Context, p *AgentAttachPayload) (res *AgentTicket, err error)
- func (c *Client) Release(ctx context.Context, p *ReleasePayload) (res *AgentRelease, err error)
- func (c *Client) Renew(ctx context.Context, p *RenewPayload) (res *AgentRenew, err error)
- func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *AgentStatus, err error)
- type Endpoints
- type Forbidden
- type Invalid
- type NotFound
- type ReleasePayload
- type RenewPayload
- 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 = "agent"
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 = [4]string{"attach", "renew", "status", "release"}
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 NewAttachEndpoint ¶
NewAttachEndpoint returns an endpoint function that calls the method "attach" of service "agent".
func NewReleaseEndpoint ¶
NewReleaseEndpoint returns an endpoint function that calls the method "release" of service "agent".
func NewRenewEndpoint ¶
NewRenewEndpoint returns an endpoint function that calls the method "renew" of service "agent".
func NewStatusEndpoint ¶
NewStatusEndpoint returns an endpoint function that calls the method "status" of service "agent".
func NewViewedAgentRelease ¶
func NewViewedAgentRelease(res *AgentRelease, view string) *agentviews.AgentRelease
NewViewedAgentRelease initializes viewed result type AgentRelease from result type AgentRelease using the given view.
func NewViewedAgentRenew ¶
func NewViewedAgentRenew(res *AgentRenew, view string) *agentviews.AgentRenew
NewViewedAgentRenew initializes viewed result type AgentRenew from result type AgentRenew using the given view.
func NewViewedAgentStatus ¶
func NewViewedAgentStatus(res *AgentStatus, view string) *agentviews.AgentStatus
NewViewedAgentStatus initializes viewed result type AgentStatus from result type AgentStatus using the given view.
func NewViewedAgentTicket ¶
func NewViewedAgentTicket(res *AgentTicket, view string) *agentviews.AgentTicket
NewViewedAgentTicket initializes viewed result type AgentTicket from result type AgentTicket using the given view.
Types ¶
type AgentAttachPayload ¶
type AgentAttachPayload struct {
// Workspace namespace
Namespace string
// Workspace name
Name string
// Viewer-chosen participant label, echoed in session records. Not an
// authorization boundary
Participant *string
}
AgentAttachPayload is the payload type of the agent service attach method.
type AgentRelease ¶
type AgentRelease struct {
// Whether the session is gone (unknown ids report ok: best-effort release)
OK bool
}
AgentRelease is the result type of the agent service release method.
func NewAgentRelease ¶
func NewAgentRelease(vres *agentviews.AgentRelease) *AgentRelease
NewAgentRelease initializes result type AgentRelease from viewed result type AgentRelease.
type AgentRenew ¶
type AgentRenew struct {
// Renewed lifetime in milliseconds
TTLMs int
// Agent ticket/API revision
Protocol int
}
AgentRenew is the result type of the agent service renew method.
func NewAgentRenew ¶
func NewAgentRenew(vres *agentviews.AgentRenew) *AgentRenew
NewAgentRenew initializes result type AgentRenew from viewed result type AgentRenew.
type AgentStatus ¶
type AgentStatus struct {
// Whether at least one live agent session is bound to this workspace
Active bool
// Live (unexpired) session count for this workspace
Sessions int
// Agent ticket/API revision
Protocol int
}
AgentStatus is the result type of the agent service status method.
func NewAgentStatus ¶
func NewAgentStatus(vres *agentviews.AgentStatus) *AgentStatus
NewAgentStatus initializes result type AgentStatus from viewed result type AgentStatus.
type AgentTicket ¶
type AgentTicket struct {
// Opaque server-side session identifier for renew/release correlation. Never
// sent to the guest
ID string
// Signed bearer ticket (id.payload.signature) to present in the agent attach
// message
Ticket string
// Ticket/session lifetime in milliseconds; renew at half of it
TTLMs int
// Agent ticket/API revision
Protocol int
}
AgentTicket is the result type of the agent service attach method.
func NewAgentTicket ¶
func NewAgentTicket(vres *agentviews.AgentTicket) *AgentTicket
NewAgentTicket initializes result type AgentTicket from viewed result type AgentTicket.
type Client ¶
type Client struct {
AttachEndpoint goa.Endpoint
RenewEndpoint goa.Endpoint
StatusEndpoint goa.Endpoint
ReleaseEndpoint goa.Endpoint
}
Client is the "agent" service client.
func (*Client) Attach ¶
func (c *Client) Attach(ctx context.Context, p *AgentAttachPayload) (res *AgentTicket, err error)
Attach calls the "attach" endpoint of the "agent" service. Attach may return the following errors:
- "unauthorized" (type Unauthorized)
- "forbidden" (type Forbidden)
- "not_found" (type NotFound)
- "invalid" (type Invalid)
- error: internal error
func (*Client) Release ¶
func (c *Client) Release(ctx context.Context, p *ReleasePayload) (res *AgentRelease, err error)
Release calls the "release" endpoint of the "agent" service. Release may return the following errors:
- "unauthorized" (type Unauthorized)
- "forbidden" (type Forbidden)
- "not_found" (type NotFound)
- error: internal error
func (*Client) Renew ¶
func (c *Client) Renew(ctx context.Context, p *RenewPayload) (res *AgentRenew, err error)
Renew calls the "renew" endpoint of the "agent" service. Renew may return the following errors:
- "unauthorized" (type Unauthorized)
- "forbidden" (type Forbidden)
- "not_found" (type NotFound)
- error: internal error
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *AgentStatus, err error)
Status calls the "status" endpoint of the "agent" service. Status may return the following errors:
- "unauthorized" (type Unauthorized)
- "forbidden" (type Forbidden)
- "not_found" (type NotFound)
- error: internal error
type Endpoints ¶
type Endpoints struct {
Attach goa.Endpoint
Renew goa.Endpoint
Status goa.Endpoint
Release goa.Endpoint
}
Endpoints wraps the "agent" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "agent" 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 attach 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 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 ReleasePayload ¶
type ReleasePayload struct {
// Workspace namespace
Namespace string
// Workspace name
Name string
// Server-side session identifier from attach
SessionID string
}
ReleasePayload is the payload type of the agent service release method.
type RenewPayload ¶
type RenewPayload struct {
// Workspace namespace
Namespace string
// Workspace name
Name string
// Server-side session identifier from attach
SessionID string
}
RenewPayload is the payload type of the agent service renew method.
type Service ¶
type Service interface {
// Attach a controller to a workspace's guest agent session, minting a
// short-lived ticket
Attach(context.Context, *AgentAttachPayload) (res *AgentTicket, err error)
// Renew a workspace guest agent session by its server-side id
// (X-KW-Agent-Session header)
Renew(context.Context, *RenewPayload) (res *AgentRenew, err error)
// Report live agent session state for a workspace
Status(context.Context, *StatusPayload) (res *AgentStatus, err error)
// Release a workspace guest agent session by its server-side id (best-effort;
// unknown ids report ok)
Release(context.Context, *ReleasePayload) (res *AgentRelease, err error)
}
Workspace guest agent sessions: short-lived attach tickets with renew/release for the proxy bridge
type StatusPayload ¶
StatusPayload is the payload type of the agent 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.