Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachAgentPath

func AttachAgentPath(name string) string

AttachAgentPath returns the URL path to the agent service attach HTTP endpoint.

func BuildAttachPayload

func BuildAttachPayload(agentAttachBody string, agentAttachName string, agentAttachNamespace string) (*agent.AgentAttachPayload, error)

BuildAttachPayload builds the payload for the agent attach endpoint from CLI flags.

func BuildReleasePayload

func BuildReleasePayload(agentReleaseName string, agentReleaseNamespace string, agentReleaseSessionID string) (*agent.ReleasePayload, error)

BuildReleasePayload builds the payload for the agent release endpoint from CLI flags.

func BuildRenewPayload

func BuildRenewPayload(agentRenewName string, agentRenewNamespace string, agentRenewSessionID string) (*agent.RenewPayload, error)

BuildRenewPayload builds the payload for the agent renew endpoint from CLI flags.

func BuildStatusPayload

func BuildStatusPayload(agentStatusName string, agentStatusNamespace string) (*agent.StatusPayload, error)

BuildStatusPayload builds the payload for the agent status endpoint from CLI flags.

func DecodeAttachResponse

func DecodeAttachResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeAttachResponse returns a decoder for responses returned by the agent attach endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeAttachResponse may return the following errors:

  • "forbidden" (type agent.Forbidden): http.StatusForbidden
  • "invalid" (type agent.Invalid): http.StatusBadRequest
  • "not_found" (type agent.NotFound): http.StatusNotFound
  • "unauthorized" (type agent.Unauthorized): http.StatusUnauthorized
  • error: internal error

func DecodeReleaseResponse

func DecodeReleaseResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeReleaseResponse returns a decoder for responses returned by the agent release endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeReleaseResponse may return the following errors:

  • "forbidden" (type agent.Forbidden): http.StatusForbidden
  • "not_found" (type agent.NotFound): http.StatusNotFound
  • "unauthorized" (type agent.Unauthorized): http.StatusUnauthorized
  • error: internal error

func DecodeRenewResponse

func DecodeRenewResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeRenewResponse returns a decoder for responses returned by the agent renew endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeRenewResponse may return the following errors:

  • "forbidden" (type agent.Forbidden): http.StatusForbidden
  • "not_found" (type agent.NotFound): http.StatusNotFound
  • "unauthorized" (type agent.Unauthorized): http.StatusUnauthorized
  • error: internal error

func DecodeStatusResponse

func DecodeStatusResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeStatusResponse returns a decoder for responses returned by the agent status endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeStatusResponse may return the following errors:

  • "forbidden" (type agent.Forbidden): http.StatusForbidden
  • "not_found" (type agent.NotFound): http.StatusNotFound
  • "unauthorized" (type agent.Unauthorized): http.StatusUnauthorized
  • error: internal error

func EncodeAttachRequest

func EncodeAttachRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeAttachRequest returns an encoder for requests sent to the agent attach server.

func EncodeReleaseRequest

func EncodeReleaseRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeReleaseRequest returns an encoder for requests sent to the agent release server.

func EncodeRenewRequest

func EncodeRenewRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeRenewRequest returns an encoder for requests sent to the agent renew server.

func EncodeStatusRequest

func EncodeStatusRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeStatusRequest returns an encoder for requests sent to the agent status server.

func NewAttachAgentTicketOK

func NewAttachAgentTicketOK(body *AttachResponseBody) *agentviews.AgentTicketView

NewAttachAgentTicketOK builds a "agent" service "attach" endpoint result from a HTTP "OK" response.

func NewAttachForbidden

func NewAttachForbidden(body string) agent.Forbidden

NewAttachForbidden builds a agent service attach endpoint forbidden error.

func NewAttachInvalid

func NewAttachInvalid(body string) agent.Invalid

NewAttachInvalid builds a agent service attach endpoint invalid error.

func NewAttachNotFound

func NewAttachNotFound(body string) agent.NotFound

NewAttachNotFound builds a agent service attach endpoint not_found error.

func NewAttachUnauthorized

func NewAttachUnauthorized(body string) agent.Unauthorized

NewAttachUnauthorized builds a agent service attach endpoint unauthorized error.

func NewReleaseAgentReleaseOK

func NewReleaseAgentReleaseOK(body *ReleaseResponseBody) *agentviews.AgentReleaseView

NewReleaseAgentReleaseOK builds a "agent" service "release" endpoint result from a HTTP "OK" response.

func NewReleaseForbidden

func NewReleaseForbidden(body string) agent.Forbidden

NewReleaseForbidden builds a agent service release endpoint forbidden error.

func NewReleaseNotFound

func NewReleaseNotFound(body string) agent.NotFound

NewReleaseNotFound builds a agent service release endpoint not_found error.

func NewReleaseUnauthorized

func NewReleaseUnauthorized(body string) agent.Unauthorized

NewReleaseUnauthorized builds a agent service release endpoint unauthorized error.

func NewRenewAgentRenewOK

func NewRenewAgentRenewOK(body *RenewResponseBody) *agentviews.AgentRenewView

NewRenewAgentRenewOK builds a "agent" service "renew" endpoint result from a HTTP "OK" response.

func NewRenewForbidden

func NewRenewForbidden(body string) agent.Forbidden

NewRenewForbidden builds a agent service renew endpoint forbidden error.

func NewRenewNotFound

func NewRenewNotFound(body string) agent.NotFound

NewRenewNotFound builds a agent service renew endpoint not_found error.

func NewRenewUnauthorized

func NewRenewUnauthorized(body string) agent.Unauthorized

NewRenewUnauthorized builds a agent service renew endpoint unauthorized error.

func NewStatusAgentStatusOK

func NewStatusAgentStatusOK(body *StatusResponseBody) *agentviews.AgentStatusView

NewStatusAgentStatusOK builds a "agent" service "status" endpoint result from a HTTP "OK" response.

func NewStatusForbidden

func NewStatusForbidden(body string) agent.Forbidden

NewStatusForbidden builds a agent service status endpoint forbidden error.

func NewStatusNotFound

func NewStatusNotFound(body string) agent.NotFound

NewStatusNotFound builds a agent service status endpoint not_found error.

func NewStatusUnauthorized

func NewStatusUnauthorized(body string) agent.Unauthorized

NewStatusUnauthorized builds a agent service status endpoint unauthorized error.

func ReleaseAgentPath

func ReleaseAgentPath(name string) string

ReleaseAgentPath returns the URL path to the agent service release HTTP endpoint.

func RenewAgentPath

func RenewAgentPath(name string) string

RenewAgentPath returns the URL path to the agent service renew HTTP endpoint.

func StatusAgentPath

func StatusAgentPath(name string) string

StatusAgentPath returns the URL path to the agent service status HTTP endpoint.

Types

type AttachRequestBody

type AttachRequestBody struct {
	// Viewer-chosen participant label, echoed in session records. Not an
	// authorization boundary
	Participant *string `form:"participant,omitempty" json:"participant,omitempty" xml:"participant,omitempty"`
}

AttachRequestBody is the type of the "agent" service "attach" endpoint HTTP request body.

func NewAttachRequestBody

func NewAttachRequestBody(p *agent.AgentAttachPayload) *AttachRequestBody

NewAttachRequestBody builds the HTTP request body from the payload of the "attach" endpoint of the "agent" service.

type AttachResponseBody

type AttachResponseBody struct {
	// Opaque server-side session identifier for renew/release correlation. Never
	// sent to the guest
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Signed bearer ticket (id.payload.signature) to present in the agent attach
	// message
	Ticket *string `form:"ticket,omitempty" json:"ticket,omitempty" xml:"ticket,omitempty"`
	// Ticket/session lifetime in milliseconds; renew at half of it
	TTLMs *int `form:"ttl_ms,omitempty" json:"ttl_ms,omitempty" xml:"ttl_ms,omitempty"`
	// Agent ticket/API revision
	Protocol *int `form:"protocol,omitempty" json:"protocol,omitempty" xml:"protocol,omitempty"`
}

AttachResponseBody is the type of the "agent" service "attach" endpoint HTTP response body.

type Client

type Client struct {
	// Attach Doer is the HTTP client used to make requests to the attach endpoint.
	AttachDoer goahttp.Doer

	// Renew Doer is the HTTP client used to make requests to the renew endpoint.
	RenewDoer goahttp.Doer

	// Status Doer is the HTTP client used to make requests to the status endpoint.
	StatusDoer goahttp.Doer

	// Release Doer is the HTTP client used to make requests to the release
	// endpoint.
	ReleaseDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the agent service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the agent service servers.

func (*Client) Attach

func (c *Client) Attach() goa.Endpoint

Attach returns an endpoint that makes HTTP requests to the agent service attach server.

func (*Client) BuildAttachRequest

func (c *Client) BuildAttachRequest(ctx context.Context, v any) (*http.Request, error)

BuildAttachRequest instantiates a HTTP request object with method and path set to call the "agent" service "attach" endpoint

func (*Client) BuildReleaseRequest

func (c *Client) BuildReleaseRequest(ctx context.Context, v any) (*http.Request, error)

BuildReleaseRequest instantiates a HTTP request object with method and path set to call the "agent" service "release" endpoint

func (*Client) BuildRenewRequest

func (c *Client) BuildRenewRequest(ctx context.Context, v any) (*http.Request, error)

BuildRenewRequest instantiates a HTTP request object with method and path set to call the "agent" service "renew" endpoint

func (*Client) BuildStatusRequest

func (c *Client) BuildStatusRequest(ctx context.Context, v any) (*http.Request, error)

BuildStatusRequest instantiates a HTTP request object with method and path set to call the "agent" service "status" endpoint

func (*Client) Release

func (c *Client) Release() goa.Endpoint

Release returns an endpoint that makes HTTP requests to the agent service release server.

func (*Client) Renew

func (c *Client) Renew() goa.Endpoint

Renew returns an endpoint that makes HTTP requests to the agent service renew server.

func (*Client) Status

func (c *Client) Status() goa.Endpoint

Status returns an endpoint that makes HTTP requests to the agent service status server.

type ReleaseResponseBody

type ReleaseResponseBody struct {
	// Whether the session is gone (unknown ids report ok: best-effort release)
	OK *bool `form:"ok,omitempty" json:"ok,omitempty" xml:"ok,omitempty"`
}

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

type RenewResponseBody

type RenewResponseBody struct {
	// Renewed lifetime in milliseconds
	TTLMs *int `form:"ttl_ms,omitempty" json:"ttl_ms,omitempty" xml:"ttl_ms,omitempty"`
	// Agent ticket/API revision
	Protocol *int `form:"protocol,omitempty" json:"protocol,omitempty" xml:"protocol,omitempty"`
}

RenewResponseBody is the type of the "agent" service "renew" endpoint HTTP response body.

type StatusResponseBody

type StatusResponseBody struct {
	// Whether at least one live agent session is bound to this workspace
	Active *bool `form:"active,omitempty" json:"active,omitempty" xml:"active,omitempty"`
	// Live (unexpired) session count for this workspace
	Sessions *int `form:"sessions,omitempty" json:"sessions,omitempty" xml:"sessions,omitempty"`
	// Agent ticket/API revision
	Protocol *int `form:"protocol,omitempty" json:"protocol,omitempty" xml:"protocol,omitempty"`
}

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

Jump to

Keyboard shortcuts

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