Documentation ¶
Overview ¶
Package controller manages the different versions of the API.
Index ¶
- func APIMux(cfg APIMuxConfig, options ...func(opts *Options)) http.Handler
- func Cors(origin string) web.Middleware
- func DebugMux(build string, log *zap.SugaredLogger) http.Handler
- func DebugStandardLibraryMux() *http.ServeMux
- func WithCORS(origin string) func(opts *Options)
- type APIMuxConfig
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIMux ¶
func APIMux(cfg APIMuxConfig, options ...func(opts *Options)) http.Handler
APIMux constructs a http.Handler with all application routes defined.
func Cors ¶
func Cors(origin string) web.Middleware
Cors sets the response headers needed for Cross-Origin Resource Sharing
func DebugMux ¶
func DebugMux(build string, log *zap.SugaredLogger) http.Handler
DebugMux registers all the debug standard library routes and then custom debug application routes for the service. This bypassing the use of the DefaultServerMux. Using the DefaultServerMux would be a security risk since a dependency could inject a handler into our service without us knowing it.
func DebugStandardLibraryMux ¶
DebugStandardLibraryMux registers all the debug routes from the standard library into a new mux bypassing the use of the DefaultServerMux. Using the DefaultServerMux would be a security risk since a dependency could inject a handler into our service without us knowing it.
Types ¶
type APIMuxConfig ¶
type APIMuxConfig struct { Shutdown chan os.Signal Log *zap.SugaredLogger }
APIMuxConfig contains all the mandatory systems required by controller.
Directories ¶
Path | Synopsis |
---|---|
Package checkgrp maintains the group of controller for health checking.
|
Package checkgrp maintains the group of controller for health checking. |
Package v1 contains the full set of handler functions and routes supported by the v1 web api.
|
Package v1 contains the full set of handler functions and routes supported by the v1 web api. |