Documentation ¶
Index ¶
- type Envelope
- func (e *Envelope) Finish(w http.ResponseWriter, r *http.Request, logger logging.Writer)
- func (e *Envelope) Render(w http.ResponseWriter, r *http.Request) error
- func (e *Envelope) SetError(err apierror.HTTPError) *Envelope
- func (e *Envelope) SetPagination(p params.Pagination) *Envelope
- func (e *Envelope) SetResponse(resp any) *Envelope
- func (e *Envelope) SetSuccess() *Envelope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { Success bool `json:"success"` RequestID string `json:"request_id"` Time string `json:"time"` Data any `json:"data"` Error string `json:"error,omitempty"` Errors []string `json:"errors,omitempty"` Message string `json:"message,omitempty"` HTTPStatusCode int `json:"-"` Pagination *params.Pagination `json:"pagination,omitempty"` }
func GetEnvelopeAndLogger ¶ added in v0.0.12
func ReadEnvelope ¶
func (*Envelope) SetPagination ¶ added in v0.0.8
func (e *Envelope) SetPagination(p params.Pagination) *Envelope
func (*Envelope) SetResponse ¶
func (*Envelope) SetSuccess ¶
Click to show internal directories.
Click to hide internal directories.