Documentation
¶
Index ¶
- func IsBadRequestError(err error) bool
- func IsExpiredResourceError(err error) bool
- func IsInternalServerError(err error) bool
- func IsNotFoundError(err error) bool
- func IsOutdatedResourceError(err error) bool
- func IsResourceAlreadyCreatedError(err error) bool
- func IsUnauthorizedError(err error) bool
- func NewBadRequestError(key string) error
- func NewExpiredResourceError(key string) error
- func NewInternalServerError(key string) error
- func NewNotFoundError(key string) error
- func NewOutdatedResourceError(key string) error
- func NewResourceAlreadyCreatedError(key string) error
- func NewUnauthorizedError(key string, subjectAndMessage ...string) error
- type BadRequestError
- type ErrorWithKey
- type ExpiredResourceError
- type InternalServerError
- type NotFoundError
- type OutdatedResourceError
- type ResourceAlreadyCreatedError
- type UnauthorizedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequestError ¶
IsBadRequestError verify if an error is a BadRequestError
func IsExpiredResourceError ¶
IsExpiresResourceError verify if an error is a ExpiredResourceError
func IsInternalServerError ¶
IsInternalServerError verify if an error is a InternalServerError
func IsNotFoundError ¶
IsNotFoundError verify if an error is a NotFoundError
func IsOutdatedResourceError ¶
IsResourceAlreadyCreatedError verify if an error is a ResourceAlreadyCreatedError
func IsResourceAlreadyCreatedError ¶
IsResourceAlreadyCreatedError verify if an error is a ResourceAlreadyCreatedError
func IsUnauthorizedError ¶
IsUnauthorizedError verify if an error is a UnauthorizedError
func NewBadRequestError ¶
NewBadRequestError return a new BadRequestError
func NewExpiredResourceError ¶
NewExpiredResourceError return a new ExpiredResourceError
func NewInternalServerError ¶
NewInternalServerError return a new InternalServerError
func NewNotFoundError ¶
NewNotFoundError return a new NotFoundError
func NewOutdatedResourceError ¶
NewOutdatedResourceError return a new OutdatedResourceError
func NewResourceAlreadyCreatedError ¶
NewResourceAlreadyExist return a new ResourceAlreadyExist
func NewUnauthorizedError ¶
NewUnauthorizedError return a new UnauthorizedError
Types ¶
type BadRequestError ¶
type BadRequestError struct {
ErrorWithKey
}
BadRequestError is used when the given parameters does not match requirements
type ErrorWithKey ¶
type ErrorWithKey struct {
Key string
}
func (*ErrorWithKey) Error ¶
func (e *ErrorWithKey) Error() string
type ExpiredResourceError ¶
type ExpiredResourceError struct {
ErrorWithKey
}
ExpiresResourceError is used when the given resource has expired
type InternalServerError ¶
type InternalServerError struct {
ErrorWithKey
}
InternalServerError is used when an error unexpected appears
type NotFoundError ¶
type NotFoundError struct {
ErrorWithKey
}
NotFoundError is used when we cannot find a specified resource
type OutdatedResourceError ¶
type OutdatedResourceError struct {
ErrorWithKey
}
ResourceAlreadyCreatedError is used when a resource already exist and could not be created another time
type ResourceAlreadyCreatedError ¶
type ResourceAlreadyCreatedError struct {
ErrorWithKey
}
ResourceAlreadyCreatedError is used when a resource already exist and could not be created another time
type UnauthorizedError ¶
type UnauthorizedError struct {
}
UnauthorizedError is used when action is not authorized