Documentation
¶
Index ¶
- Variables
- func NewBadRequestError(msg string, a ...any) error
- func NewConflictError(msg string, a ...any) error
- func NewDuplicateUserError(msg string, a ...any) error
- func NewForbiddenError(msg string, a ...any) error
- func NewInstanceTransitionError(from, to params.InstanceStatus) error
- func NewMissingSecretError(msg string, a ...any) error
- func NewNoCapacityError(msg string, a ...any) error
- func NewNoPoolsAvailableError(msg string, a ...any) error
- func NewNotFoundError(msg string, a ...any) error
- func NewProviderError(msg string, a ...any) error
- func NewTimeoutError(msg string, a ...any) error
- func NewUnauthorizedError(msg string, a ...any) error
- func NewUnprocessableError(msg string, a ...any) error
- type BadRequestError
- type ConflictError
- type DuplicateUserError
- type ForbiddenError
- type InstanceTransitionError
- type MissingSecretError
- type NoCapacityError
- type NoPoolsAvailableError
- type NotFoundError
- type ProviderError
- type TimoutError
- type UnauthorizedError
- type UnprocessableError
Constants ¶
This section is empty.
Variables ¶
var ( // authorization to perform a request ErrUnauthorized = NewUnauthorizedError("Unauthorized") // ErrForbidden is returned when a user does not have // permission to perform a request ErrForbidden = NewForbiddenError("Forbidden") // ErrNotFound is returned if an object is not found in // the database. ErrNotFound = NewNotFoundError("not found") // ErrDuplicateUser is returned when creating a user, if the // user already exists. ErrDuplicateEntity = NewDuplicateUserError("duplicate") // ErrBadRequest is returned is a malformed request is sent ErrBadRequest = NewBadRequestError("invalid request") // ErrTimeout is returned when a timeout occurs. ErrTimeout = NewTimeoutError("timed out") ErrUnprocessable = NewUnprocessableError("cannot process request") ErrNoPoolsAvailable = NewNoPoolsAvailableError("no pools available") ErrNoCapacity = NewNoCapacityError("no capacity available") )
Functions ¶
func NewBadRequestError ¶
NewBadRequestError returns a new BadRequestError
func NewConflictError ¶
NewConflictError returns a new ConflictError
func NewDuplicateUserError ¶
NewDuplicateUserError returns a new DuplicateUserError
func NewForbiddenError ¶ added in v0.1.10
NewForbiddenError returns a new ForbiddenError
func NewInstanceTransitionError ¶ added in v0.1.10
func NewInstanceTransitionError(from, to params.InstanceStatus) error
NewInstanceTransitionError returns an InstanceTransitionError describing an invalid instance status state machine transition.
func NewMissingSecretError ¶
NewMissingSecretError returns a new MissingSecretError
func NewNoCapacityError ¶ added in v0.1.10
NewNoCapacityError returns a new NoCapacityError
func NewNoPoolsAvailableError ¶ added in v0.1.7
NewNoPoolsAvailableError returns a new NoPoolsAvailableError
func NewNotFoundError ¶
NewNotFoundError returns a new NotFoundError
func NewProviderError ¶
NewProviderError returns a new ProviderError
func NewTimeoutError ¶ added in v0.1.7
NewTimeoutError returns a new TimoutError
func NewUnauthorizedError ¶
NewUnauthorizedError returns a new UnauthorizedError
func NewUnprocessableError ¶ added in v0.1.7
NewUnprocessableError returns a new UnprocessableError
Types ¶
type BadRequestError ¶
type BadRequestError struct {
// contains filtered or unexported fields
}
BadRequestError is returned when a malformed request is received
func (*BadRequestError) Is ¶ added in v0.1.7
func (p *BadRequestError) Is(target error) bool
type ConflictError ¶
type ConflictError struct {
// contains filtered or unexported fields
}
ConflictError is returned when a conflicting request is made
func (*ConflictError) Is ¶ added in v0.1.7
func (p *ConflictError) Is(target error) bool
type DuplicateUserError ¶
type DuplicateUserError struct {
// contains filtered or unexported fields
}
DuplicateUserError is returned when a duplicate user is requested
func (*DuplicateUserError) Is ¶ added in v0.1.7
func (p *DuplicateUserError) Is(target error) bool
type ForbiddenError ¶ added in v0.1.10
type ForbiddenError struct {
// contains filtered or unexported fields
}
ForbiddenError is returned when a request is not allowed
func (*ForbiddenError) Is ¶ added in v0.1.10
func (p *ForbiddenError) Is(target error) bool
type InstanceTransitionError ¶ added in v0.1.10
type InstanceTransitionError struct {
From params.InstanceStatus
To params.InstanceStatus
// contains filtered or unexported fields
}
InstanceTransitionError is returned when a requested instance status transition is rejected by the state machine. It carries the current (From) and requested (To) statuses as their proper type, so callers working with a params.Instance can compare them directly (via errors.As) without casting through strings, and decide whether the refusal is benign for their intent (for example, the instance is already further along the same terminal path) or a genuine error to stop on. It also reports as a BadRequestError, so it maps to an HTTP 400.
func (*InstanceTransitionError) Error ¶ added in v0.1.10
func (b *InstanceTransitionError) Error() string
func (*InstanceTransitionError) Is ¶ added in v0.1.10
func (e *InstanceTransitionError) Is(target error) bool
type MissingSecretError ¶
type MissingSecretError struct {
// contains filtered or unexported fields
}
MissingSecretError is returned the secret to validate a webhook is missing
func (*MissingSecretError) Is ¶ added in v0.1.7
func (p *MissingSecretError) Is(target error) bool
type NoCapacityError ¶ added in v0.1.10
type NoCapacityError struct {
// contains filtered or unexported fields
}
NoCapacityError is returned when there is no capacity available.
func (*NoCapacityError) Is ¶ added in v0.1.10
func (p *NoCapacityError) Is(target error) bool
type NoPoolsAvailableError ¶ added in v0.1.7
type NoPoolsAvailableError struct {
// contains filtered or unexported fields
}
NoPoolsAvailableError is returned when there are no pools available.
func (*NoPoolsAvailableError) Error ¶ added in v0.1.7
func (b *NoPoolsAvailableError) Error() string
func (*NoPoolsAvailableError) Is ¶ added in v0.1.7
func (p *NoPoolsAvailableError) Is(target error) bool
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError is returned when a resource is not found
func (*NotFoundError) Is ¶ added in v0.1.7
func (p *NotFoundError) Is(target error) bool
type ProviderError ¶
type ProviderError struct {
// contains filtered or unexported fields
}
UnauthorizedError is returned when a request is unauthorized
func (*ProviderError) Is ¶ added in v0.1.7
func (p *ProviderError) Is(target error) bool
type TimoutError ¶ added in v0.1.7
type TimoutError struct {
// contains filtered or unexported fields
}
TimoutError is returned when an operation times out.
func (*TimoutError) Is ¶ added in v0.1.7
func (p *TimoutError) Is(target error) bool
type UnauthorizedError ¶
type UnauthorizedError struct {
// contains filtered or unexported fields
}
UnauthorizedError is returned when a request is unauthorized
func (*UnauthorizedError) Is ¶ added in v0.1.7
func (p *UnauthorizedError) Is(target error) bool
type UnprocessableError ¶ added in v0.1.7
type UnprocessableError struct {
// contains filtered or unexported fields
}
UnprocessableError is returned when a request cannot be processed.
func (*UnprocessableError) Is ¶ added in v0.1.7
func (p *UnprocessableError) Is(target error) bool