Versions in this module Expand all Collapse all v0 v0.2.1 Nov 16, 2015 Changes in this version + var ErrorCodeDenied = Register("errcode", ErrorDescriptor{ ... }) + var ErrorCodeUnauthorized = Register("errcode", ErrorDescriptor{ ... }) + var ErrorCodeUnavailable = Register("errcode", ErrorDescriptor{ ... }) + var ErrorCodeUnknown = Register("errcode", ErrorDescriptor{ ... }) + var ErrorCodeUnsupported = Register("errcode", ErrorDescriptor{ ... }) + func GetGroupNames() []string + func ServeJSON(w http.ResponseWriter, err error) error + type Error struct + Code ErrorCode + Detail interface{} + Message string + func (e Error) Error() string + func (e Error) ErrorCode() ErrorCode + func (e Error) WithArgs(args ...interface{}) Error + func (e Error) WithDetail(detail interface{}) Error + type ErrorCode int + func ParseErrorCode(value string) ErrorCode + func Register(group string, descriptor ErrorDescriptor) ErrorCode + func (ec *ErrorCode) UnmarshalText(text []byte) error + func (ec ErrorCode) Descriptor() ErrorDescriptor + func (ec ErrorCode) Error() string + func (ec ErrorCode) ErrorCode() ErrorCode + func (ec ErrorCode) MarshalText() (text []byte, err error) + func (ec ErrorCode) Message() string + func (ec ErrorCode) String() string + func (ec ErrorCode) WithArgs(args ...interface{}) Error + func (ec ErrorCode) WithDetail(detail interface{}) Error + type ErrorCoder interface + ErrorCode func() ErrorCode + type ErrorDescriptor struct + Code ErrorCode + Description string + HTTPStatusCode int + Message string + Value string + func GetErrorAllDescriptors() []ErrorDescriptor + func GetErrorCodeGroup(name string) []ErrorDescriptor + type Errors []error + func (errs *Errors) UnmarshalJSON(data []byte) error + func (errs Errors) Error() string + func (errs Errors) Len() int + func (errs Errors) MarshalJSON() ([]byte, error)