template

package
v0.0.0-...-cb2f69f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TemplatedError

type TemplatedError[T jsonErrorMessage] struct {
	// contains filtered or unexported fields
}

func NewInternalRouteError

func NewInternalRouteError(host, path string) *TemplatedError[internalRouteData]

NewInternalRouteError reports that the request addressed a control-plane route that the proxy does not route.

404 rather than 403, because the route genuinely does not exist at this address — it is only reachable on the control plane's own network path. The message still names the reason, since the routes are described in a public OpenAPI spec and a vague response would buy no secrecy while costing every caller a debugging session.

The sandbox ID is deliberately absent from the body: the caller learns nothing about which sandbox it failed to address that it did not already supply.

func NewPortClosedError

func NewPortClosedError(sandboxId, host string, port uint64) *TemplatedError[portClosedError]

func NewSandboxNotFoundError

func NewSandboxNotFoundError(sandboxId, host string) *TemplatedError[sandboxNotFoundData]

func NewSandboxResumePermissionDeniedError

func NewSandboxResumePermissionDeniedError(sandboxId, host string) *TemplatedError[sandboxResumePermissionDeniedData]

func NewSandboxStillTransitioningError

func NewSandboxStillTransitioningError(sandboxId, host string) *TemplatedError[sandboxStillTransitioningData]

func NewSandboxTooManyConnectionsError

func NewSandboxTooManyConnectionsError(sandboxId, host string, connectionLimit int) *TemplatedError[sandboxTooManyConnectionsData]

func NewTeamSandboxLimitError

func NewTeamSandboxLimitError(sandboxId, host, message string) *TemplatedError[teamSandboxLimitData]

func NewTrafficAccessTokenInvalidHeader

func NewTrafficAccessTokenInvalidHeader(sandboxId, host string, header string) *TemplatedError[trafficAccessTokenErrData]

func NewTrafficAccessTokenMissingHeader

func NewTrafficAccessTokenMissingHeader(sandboxId, host string, header string) *TemplatedError[trafficAccessTokenErrData]

func (*TemplatedError[T]) HandleError

func (e *TemplatedError[T]) HandleError(
	w http.ResponseWriter,
	r *http.Request,
) error

Jump to

Keyboard shortcuts

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