Documentation ¶
Overview ¶
Package plug encapsulates the plugin style that this framework uses. Using either the code method, which relies on the go plugin package, as well as the package package (yes.) Or the configuration style of defining models within a json file. Plugins are added to a pluginManager which is added to the server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthCheck ¶
func HealthCheck(w http.ResponseWriter, req *http.Request, ctx config.AppContext)
HealthCheck is the generic health check endpoint for the user, instantianted when called for in the config file.
func MakeHandler ¶
func MakeHandler(ctx config.AppContext, fn HandlerFunc) http.HandlerFunc
MakeHandler will wrap a Application Context up into a handler so that users have access to things like their database connection etc in each handler.
Types ¶
type Crud ¶
type Crud interface { Get(w http.ResponseWriter, req *http.Request, ctx config.AppContext) Put(w http.ResponseWriter, req *http.Request, ctx config.AppContext) Delete(w http.ResponseWriter, req *http.Request, ctx config.AppContext) Post(w http.ResponseWriter, req *http.Request, ctx config.AppContext) }
Crud interface for the functions required by our API objects
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request, config.AppContext)
HandlerFunc type for the unwrapped version of a handler function.
type Manager ¶
type Manager struct {
Plugs []*Plug
}
Manager object to hold our plugins
func CreatePlugManager ¶
func CreatePlugManager(conf *config.ManagerConfig) (*Manager, error)
CreatePlugManager creates the manager object for Plugins
func (*Manager) AttachRoutes ¶
AttachRoutes to your router!!
func (*Manager) InitGenericRoutes ¶
func (*Manager) InitGenericRoutes(router *mux.Router, conf *config.ManagerConfig, ctx config.AppContext) error