Documentation ¶
Index ¶
- Variables
- func DecodeJson(body io.Reader, o interface{}) error
- func EncodeJson(w io.Writer, err error) error
- func EncodeJsonStatus(w io.Writer, message string, statusCode int, o interface{}) error
- type QueueError
- type QueueName
- type RateLimitError
- type Response
- type ServerResponse
- type ServiceError
- type TaskName
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyBody = errors.New("body must not be empty")
Functions ¶
func DecodeJson ¶
Types ¶
type QueueError ¶
type QueueError struct { Err error // contains filtered or unexported fields }
func (*QueueError) Delay ¶
func (e *QueueError) Delay() time.Duration
func (*QueueError) Error ¶
func (e *QueueError) Error() string
type RateLimitError ¶
type RateLimitError struct { Err error // contains filtered or unexported fields }
func (*RateLimitError) Delay ¶
func (e *RateLimitError) Delay() time.Duration
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type ServerResponse ¶
type ServerResponse struct { Response Status bool `json:"status"` Message string `json:"message"` Data json.RawMessage `json:"data,omitempty"` }
func NewErrorResponse ¶
func NewErrorResponse(msg string, statusCode int) ServerResponse
func NewServerResponse ¶
func NewServerResponse(msg string, object interface{}, statusCode int) ServerResponse
func NewServiceErrResponse ¶
func NewServiceErrResponse(err error) ServerResponse
type ServiceError ¶
type ServiceError struct {
// contains filtered or unexported fields
}
func NewServiceError ¶
func NewServiceError(errCode int, errMsg error) *ServiceError
func (*ServiceError) ErrCode ¶
func (s *ServiceError) ErrCode() int
func (*ServiceError) Error ¶
func (s *ServiceError) Error() string
Click to show internal directories.
Click to hide internal directories.