Documentation ¶
Index ¶
- Constants
- func Context(ctx context.Context) context.Context
- func LogError(err error, id string, code int)
- func NewContext() context.Context
- type Error
- type Herodot
- type JSON
- func (h *JSON) Write(ctx context.Context, w http.ResponseWriter, r *http.Request, e interface{})
- func (h *JSON) WriteCode(ctx context.Context, w http.ResponseWriter, r *http.Request, code int, ...)
- func (h *JSON) WriteCreated(ctx context.Context, w http.ResponseWriter, r *http.Request, location string, ...)
- func (h *JSON) WriteError(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)
- func (h *JSON) WriteErrorCode(ctx context.Context, w http.ResponseWriter, r *http.Request, code int, ...)
Constants ¶
View Source
const RequestIDKey key = 0
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
Types ¶
type Error ¶
type Herodot ¶
type Herodot interface { Write(ctx context.Context, w http.ResponseWriter, r *http.Request, e interface{}) WriteCode(ctx context.Context, w http.ResponseWriter, r *http.Request, code int, e interface{}) WriteCreated(ctx context.Context, w http.ResponseWriter, r *http.Request, location string, e interface{}) WriteError(ctx context.Context, w http.ResponseWriter, r *http.Request, err error) WriteErrorCode(ctx context.Context, w http.ResponseWriter, r *http.Request, code int, err error) }
type JSON ¶
type JSON struct {
Logger logrus.FieldLogger
}
func (*JSON) WriteCreated ¶
func (*JSON) WriteError ¶
Click to show internal directories.
Click to hide internal directories.