Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextIn ¶
type ContextIn struct { Port int RoutesToRegister []Routes MiddlewaresToRegister Middlewares TLSConfiguration *TLSConfiguration }
ContextIn describes dependecies needed by this package
type ContextOut ¶
type ContextOut struct {
Server Server
}
ContextOut describes dependencies exported by this package
func Bootstrap ¶
func Bootstrap(in *ContextIn) *ContextOut
Bootstrap initializes this module with ContextIn and exports resulting ContextOut
type Middlewares ¶
Middlewares runs before every route
type Routes ¶
type Routes interface {
Register(agent RoutesAgent)
}
Routes is base type for types that implement routes
type RoutesAgent ¶
type RoutesAgent interface { RegisterGet(path string, f func(w http.ResponseWriter, r *http.Request)) RegisterPost(path string, f func(w http.ResponseWriter, r *http.Request)) RegisterPut(path string, f func(w http.ResponseWriter, r *http.Request)) RegisterDelete(path string, f func(w http.ResponseWriter, r *http.Request)) }
RoutesAgent is used to expose HTTP endpoints
type TLSConfiguration ¶
type TLSConfiguration struct { // CertFile to use for serving TLS traffic CertFile string // KeyFile to use for serving TLS traffic KeyFile string }
TLSConfiguration for server
Click to show internal directories.
Click to hide internal directories.