package
0.0.0-20231027131641-93b1e7503408
Repository: https://github.com/lightstar/golib.git
Documentation: pkg.go.dev
# Packages
Package context provides context object for data that belongs to an individual http request.
Package decoder provides request decoding functionality for the context.
Package encoder provides response encoding functionality for the context package.
Package middleware provides commonly-used middleware functions for the httpservice package.
Package response provides wrapper around http.ResponseWriter used inside context object, also it provides some commonly-used response payloads.
# Functions
MustNew function creates new service with provided options and panics on any error.
New function creates new service with provided options.
WithConfig option retrieves configuration from provided configuration service.
WithDebug option sets debug mode.
WithLogger option applies provided logger.
WithName option applies provided service name.
# Constants
DefName is the default service's name.
# Interfaces
ConfigService interface used to obtain configuration from somewhere into some specific structure.
# Type aliases
HandlerFunc is a function that will handle each request under some route with all used middlewares.
MiddlewareFunc is a function that will wrap request handler to provide some shared functionality.
Option function that is fed to New and MustNew.