Documentation
¶
Index ¶
- type TemplatedError
- func NewInternalRouteError(host, path string) *TemplatedError[internalRouteData]
- func NewPortClosedError(sandboxId, host string, port uint64) *TemplatedError[portClosedError]
- func NewSandboxNotFoundError(sandboxId, host string) *TemplatedError[sandboxNotFoundData]
- func NewSandboxResumePermissionDeniedError(sandboxId, host string) *TemplatedError[sandboxResumePermissionDeniedData]
- func NewSandboxStillTransitioningError(sandboxId, host string) *TemplatedError[sandboxStillTransitioningData]
- func NewSandboxTooManyConnectionsError(sandboxId, host string, connectionLimit int) *TemplatedError[sandboxTooManyConnectionsData]
- func NewTeamSandboxLimitError(sandboxId, host, message string) *TemplatedError[teamSandboxLimitData]
- func NewTrafficAccessTokenInvalidHeader(sandboxId, host string, header string) *TemplatedError[trafficAccessTokenErrData]
- func NewTrafficAccessTokenMissingHeader(sandboxId, host string, header string) *TemplatedError[trafficAccessTokenErrData]
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
Click to show internal directories.
Click to hide internal directories.