Documentation
¶
Overview ¶
Package controlclient calls the tnl control API.
Responses cannot exceed 64 KiB. A nonempty successful response must contain one JSON value that matches the generated schema. Most requests time out after 20 seconds; certificate requests time out after 150 seconds. Network and read failures wrap ErrUnavailable, but invalid or oversized responses do not. The server problem code, not only the HTTP status, determines the returned error.
Index ¶
- Variables
- type Client
- func (c *Client) AdminDrainRelay(ctx context.Context, relayID string, body controlv1.AdminDrainRelayRequest) (controlv1.AdminRelayLease, error)
- func (c *Client) AdminListMaintenanceControls(ctx context.Context) ([]controlv1.MaintenanceControl, error)
- func (c *Client) AdminListRelays(ctx context.Context) (controlv1.AdminRelayPage, error)
- func (c *Client) AdminServerStatus(ctx context.Context) (controlv1.AdminServerStatus, error)
- func (c *Client) AdminSetMaintenanceControl(ctx context.Context, name controlv1.MaintenanceControlName, allowed bool) (controlv1.MaintenanceControl, error)
- func (c *Client) ClientIP(ctx context.Context) (controlv1.ClientIPResponse, error)
- func (c *Client) CloseRouteSession(ctx context.Context, routeSessionID string, ...) error
- func (c *Client) CreateCertificateIssuance(ctx context.Context, routeSessionID string, routeVersion uint64, ...) (controlv1.CertificateIssuance, error)
- func (c *Client) CreateRoute(ctx context.Context, body controlv1.CreateRouteRequest, idempotencyKey string) (controlv1.Route, error)
- func (c *Client) CreateRouteSession(ctx context.Context, routeID, idempotencyKey string) (controlv1.RouteSessionSetup, error)
- func (c *Client) DeleteRoute(ctx context.Context, routeID string) error
- func (c *Client) Discovery(ctx context.Context) (controlv1.ControlDiscovery, error)
- func (c *Client) GetCertificateIssuance(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) (controlv1.CertificateIssuance, error)
- func (c *Client) GetRoute(ctx context.Context, routeID string) (controlv1.Route, error)
- func (c *Client) GetRouteByHostname(ctx context.Context, teamID, hostname string) (controlv1.Route, error)
- func (c *Client) HeartbeatRouteSession(ctx context.Context, routeSessionID string, routeVersion uint64, ...) (controlv1.RouteSessionHeartbeat, error)
- func (c *Client) ListRoutes(ctx context.Context, teamID string) ([]controlv1.Route, error)
- func (c *Client) MarkCertificateChallengeReady(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) (controlv1.CertificateIssuance, error)
- func (c *Client) MarkCertificateChallengeRemoved(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) error
- func (c *Client) MarkRouteSessionCertificateInstalled(ctx context.Context, routeSessionID string, routeVersion uint64, ...) error
- func (c *Client) MarkRouteSessionReady(ctx context.Context, routeSessionID string, routeVersion uint64, ...) error
- func (c *Client) UpdateRoute(ctx context.Context, routeID string, body controlv1.UpdateRouteRequest) (controlv1.Route, error)
- type ProblemError
- type RateLimitError
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnauthenticated = errors.New("controlclient: unauthenticated") ErrNotFound = errors.New("controlclient: not found") ErrStatusConflict = errors.New("controlclient: status conflict") ErrCertificateStatus = errors.New("controlclient: certificate status conflict") ErrDNSProofPending = errors.New("controlclient: DNS setup pending") ErrRateLimited = errors.New("controlclient: rate limited") ErrUnsupported = errors.New("controlclient: unsupported") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(server string, httpClient *http.Client, access credentials.AccessToken) (*Client, error)
func NewExternallyAuthenticated ¶
NewExternallyAuthenticated creates a client whose HTTP transport adds authorization.
func (*Client) AdminDrainRelay ¶
func (c *Client) AdminDrainRelay(ctx context.Context, relayID string, body controlv1.AdminDrainRelayRequest) (controlv1.AdminRelayLease, error)
func (*Client) AdminListMaintenanceControls ¶
func (*Client) AdminListRelays ¶
func (*Client) AdminServerStatus ¶
func (*Client) AdminSetMaintenanceControl ¶
func (c *Client) AdminSetMaintenanceControl(ctx context.Context, name controlv1.MaintenanceControlName, allowed bool) (controlv1.MaintenanceControl, error)
func (*Client) CloseRouteSession ¶
func (c *Client) CloseRouteSession(ctx context.Context, routeSessionID string, token credentials.RouteSessionToken) error
func (*Client) CreateCertificateIssuance ¶
func (c *Client) CreateCertificateIssuance(ctx context.Context, routeSessionID string, routeVersion uint64, token credentials.RouteSessionToken, csrDER []byte, idempotencyKey string) (controlv1.CertificateIssuance, error)
func (*Client) CreateRoute ¶
func (*Client) CreateRouteSession ¶
func (*Client) DeleteRoute ¶
func (*Client) GetCertificateIssuance ¶
func (c *Client) GetCertificateIssuance(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) (controlv1.CertificateIssuance, error)
func (*Client) GetRouteByHostname ¶
func (c *Client) GetRouteByHostname(ctx context.Context, teamID, hostname string) (controlv1.Route, error)
GetRouteByHostname uses one filtered request instead of paging through a team's routes. Reject unfiltered responses from servers ignoring the filter.
func (*Client) HeartbeatRouteSession ¶
func (c *Client) HeartbeatRouteSession(ctx context.Context, routeSessionID string, routeVersion uint64, token credentials.RouteSessionToken) (controlv1.RouteSessionHeartbeat, error)
func (*Client) ListRoutes ¶
func (*Client) MarkCertificateChallengeReady ¶
func (c *Client) MarkCertificateChallengeReady(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) (controlv1.CertificateIssuance, error)
func (*Client) MarkCertificateChallengeRemoved ¶
func (c *Client) MarkCertificateChallengeRemoved(ctx context.Context, issuanceID string, token credentials.RouteSessionToken) error
func (*Client) MarkRouteSessionCertificateInstalled ¶
func (*Client) MarkRouteSessionReady ¶
func (c *Client) MarkRouteSessionReady(ctx context.Context, routeSessionID string, routeVersion uint64, token credentials.RouteSessionToken) error
type ProblemError ¶
func (*ProblemError) Error ¶
func (e *ProblemError) Error() string
type RateLimitError ¶
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error