Documentation
¶
Index ¶
- Variables
- func Equal(err1 error, err2 error) bool
- type Error
- func FromError(err error) *Error
- func NewBadRequest(name string, formatter string, args ...any) *Error
- func NewConflict(name string, formatter string, args ...any) *Error
- func NewContinue() *Error
- func NewCreated() *Error
- func NewForbidden(name string, formatter string, args ...any) *Error
- func NewFound(name string, formatter string, args ...any) *Error
- func NewInternalServerError(name string, formatter string, args ...any) *Error
- func NewMethodNotAllowed(name string, formatter string, args ...any) *Error
- func NewMovedPermanently(name string, formatter string, args ...any) *Error
- func NewMultipleChoices(name string, formatter string, args ...any) *Error
- func NewNoContent() *Error
- func NewNotFound(name string, formatter string, args ...any) *Error
- func NewNotImplemented(name string, formatter string, args ...any) *Error
- func NewOK() *Error
- func NewRequestTimeout(name string, formatter string, args ...any) *Error
- func NewServiceUnavailable(name string, formatter string, args ...any) *Error
- func NewUnauthorized(name string, formatter string, args ...any) *Error
- func Parse(err string) *Error
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (e *Error) Error() string
- func (x *Error) GetCode() int32
- func (x *Error) GetMsg() string
- func (x *Error) GetName() string
- func (x *Error) GetStatus() string
- func (e *Error) OK() bool
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_errors_proto protoreflect.FileDescriptor
View Source
var New = func() *Error { return &Error{} }
nil
Functions ¶
Types ¶
type Error ¶
type Error struct {
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // http status code
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // http status text
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // error name
Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` // error msg
// contains filtered or unexported fields
}
func NewBadRequest ¶
400 Bad Request
func NewForbidden ¶
403 Forbidden
func NewInternalServerError ¶
500 Internal Server Error
func NewMethodNotAllowed ¶
405 Method Not Allowed
func NewMovedPermanently ¶
301 Moved Permanently
func NewMultipleChoices ¶
300 Multiple Choices
func NewNotFound ¶
404 Not Found
func NewNotImplemented ¶
501 Not Implemented
func NewRequestTimeout ¶
408 Request Timeout
func NewServiceUnavailable ¶
503 Service Unavailable
func NewUnauthorized ¶
401 Unauthorized
func (*Error) Descriptor
deprecated
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.