Discover Packages
github.com/godwinrob/harvester
app
sdk
mid
package
Version:
v0.0.0-...-da924b9
Opens a new window with list of versions in this module.
Published: Jun 13, 2024
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Encoder
func Errors(ctx context.Context, log *logger.Logger, next Handler) (Encoder, error)
func Logger(ctx context.Context, log *logger.Logger, path string, rawQuery string, ...) (Encoder, error)
func Panics(ctx context.Context, next Handler) (resp Encoder, err error)
type Handler
type Encoder interface {
Encode() (data []byte , contentType string , err error )
}
Encoder defines behavior that can encode a data model and provide
the content type for that encoding.
Errors handles errors coming out of the call chain. It detects normal
application errors which are used to respond to the client in a uniform way.
Unexpected errors (status >= 500) are logged.
Logger writes information about the request to the logs.
Panics recovers from panics and converts the panic to an error so it is
reported in Metrics and handled in Errors.
Handler represents an api layer handler function that needs to be called.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.