Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Provide( NewRouter, )
Module contains all the dependencies that power rest api routing
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
fx.Out
Ctrl Registerable `group:"controllers"`
}
Controller is an entity used to wrap Registerables and make them available for dependency injection
func MakeController ¶
func MakeController(r Registerable) Controller
MakeController is a convenience utility function to make an api controller from a Registerable
type Controllers ¶
type Controllers struct {
fx.In
Controllers []Registerable `group:"controllers"`
}
Controllers are a grouping of all Registerables intended to be used as handlers for the API
type Registerable ¶
type Registerable interface {
Register(*httprouter.Router)
}
Registerable has a single Register method which takes an http.Handler as a single argument - intended to be used by the implementor to register handlers to a router
type Router ¶
Router is responsible for routing API requests
func NewRouter ¶
func NewRouter(registered Controllers, logger *middleware.Logger) Router
NewRouter returns an http.Handler for the On Call rest API
Click to show internal directories.
Click to hide internal directories.