Versions in this module Expand all Collapse all v0 v0.3.2 Jul 24, 2019 Changes in this version + var DefaultConflict = ErrorType + var DefaultFailedPrecondition = ErrorType + var DefaultInternal = ErrorType + var DefaultInvalidArgument = ErrorType + var DefaultNotFound = ErrorType + var DefaultPermissionDenied = ErrorType + var DefaultRequestEntityTooLarge = ErrorType + var DefaultTimeout = ErrorType + func WriteErrorResponse(w http.ResponseWriter, e SerializableError) + type Error interface + Code func() ErrorCode + InstanceID func() uuid.UUID + Name func() string + Parameters func() map[string]interface{} + func NewConflict(parameters ...Param) Error + func NewError(errorType ErrorType, parameters ...Param) Error + func NewFailedPrecondition(parameters ...Param) Error + func NewInternal(parameters ...Param) Error + func NewInvalidArgument(parameters ...Param) Error + func NewNotFound(parameters ...Param) Error + func NewPermissionDenied(parameters ...Param) Error + func NewRequestEntityTooLarge(parameters ...Param) Error + func NewTimeout(parameters ...Param) Error + func UnpackError(se SerializableError) (e Error, err error) + type ErrorCode int16 + const Conflict + const CustomClient + const CustomServer + const FailedPrecondition + const Internal + const InvalidArgument + const NotFound + const PermissionDenied + const RequestEntityTooLarge + const Timeout + func (ec *ErrorCode) UnmarshalText(data []byte) error + func (ec ErrorCode) MarshalText() ([]byte, error) + func (ec ErrorCode) StatusCode() int + func (ec ErrorCode) String() string + type ErrorType struct + func MustErrorType(code ErrorCode, name string) ErrorType + func NewErrorType(code ErrorCode, name string) (ErrorType, error) + func (et ErrorType) Code() ErrorCode + func (et ErrorType) Name() string + func (et ErrorType) String() string + type Param interface + func SafeParam(key string, val interface{}) Param + func UnsafeParam(key string, val interface{}) Param + type SerializableError struct + ErrorCode ErrorCode + ErrorInstanceID uuid.UUID + ErrorName string + Parameters json.RawMessage + func ErrorFromResponse(response *http.Response) (SerializableError, error)