Documentation ¶
Index ¶
- Constants
- func CORSMiddleware(nextHandler http.HandlerFunc) http.HandlerFunc
- func GNUMiddleware(nextHandler http.HandlerFunc) http.HandlerFunc
- func GetLogger(cfg *Config) *zap.Logger
- func GetQueryId(r *http.Request, key string) (int, error)
- func WriteError(log *zap.Logger, w http.ResponseWriter, statusCode int, err error, ...)
- func WriteJson(log *zap.Logger, w http.ResponseWriter, marshalled []byte)
- type ApiRouter
- type Config
- type DBClient
- type DBError
- type MiddlewareFunc
- type Route
- type Server
Constants ¶
View Source
const ( DBHost = "Host" DBUsername = "User" DBPass = "Pass" DBPort = "Port" Development = "Development" )
View Source
const (
Port = 8081
)
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware(nextHandler http.HandlerFunc) http.HandlerFunc
func GNUMiddleware ¶
func GNUMiddleware(nextHandler http.HandlerFunc) http.HandlerFunc
GNUMiddleware adds the X-Clacks-Overhead header to keep names alive (https://wiki.lspace.org/GNU_Terry_Pratchett)
func WriteError ¶
Types ¶
type DBClient ¶
func (*DBClient) CheckConnection ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(nextHandler http.HandlerFunc) http.HandlerFunc
type Route ¶
type Route struct { Path string Method string Handler http.HandlerFunc MiddleWare MiddlewareFunc }
Click to show internal directories.
Click to hide internal directories.