Documentation ¶
Index ¶
- Variables
- func NewModel(m interface{}) interfaces.IModel
- type CustomizePlugins
- func CachePlugin(cache interfaces.ICache) CustomizePlugins
- func ContextPlugin(context interfaces.IContext) CustomizePlugins
- func InjectPlugin(inject interfaces.IInjector) CustomizePlugins
- func MiddlewarePlugin(middleware interfaces.IMiddleware) CustomizePlugins
- func ModelPlugin(model interfaces.IModel) CustomizePlugins
- func RouterPlugin(router interfaces.IRouter) CustomizePlugins
- type Linweb
- func (lin *Linweb) AddControllers(obj ...interface{})
- func (lin *Linweb) AddMiddlewares(middlewareFunc ...interfaces.HandlerFunc)
- func (lin *Linweb) AddSingleton(objs ...interface{})
- func (lin *Linweb) AddTransient(objs ...interface{})
- func (lin *Linweb) Run(addr string) error
- func (lin *Linweb) ServeHTTP(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
var (
Cache interfaces.ICache
)
Functions ¶
Types ¶
type CustomizePlugins ¶
type CustomizePlugins func(lin *Linweb)
CustomizePlugins Add customize plugins. It is not allowed to pass in non-plugin implementations. Without customize plugins will use the default plugins.
func CachePlugin ¶
func CachePlugin(cache interfaces.ICache) CustomizePlugins
Customize cache plugin.
func ContextPlugin ¶
func ContextPlugin(context interfaces.IContext) CustomizePlugins
Customize context plugin.
func InjectPlugin ¶
func InjectPlugin(inject interfaces.IInjector) CustomizePlugins
Customize inject plugin.
func MiddlewarePlugin ¶
func MiddlewarePlugin(middleware interfaces.IMiddleware) CustomizePlugins
Customize middleware plugin.
func ModelPlugin ¶
func ModelPlugin(model interfaces.IModel) CustomizePlugins
Customize model plugin.
func RouterPlugin ¶
func RouterPlugin(router interfaces.IRouter) CustomizePlugins
Customize router plugin.
type Linweb ¶
type Linweb struct {
// contains filtered or unexported fields
}
func NewLinweb ¶
func NewLinweb(plugins ...CustomizePlugins) *Linweb
Create a new Linweb. Add customize plugins with method of plugins.go, otherwise use default plugins.
func (*Linweb) AddControllers ¶
func (lin *Linweb) AddControllers(obj ...interface{})
AddControllers Add all controllers, they must all be of pointer type
func (*Linweb) AddMiddlewares ¶
func (lin *Linweb) AddMiddlewares(middlewareFunc ...interfaces.HandlerFunc)
AddMiddlewares Add global middlewares
func (*Linweb) AddSingleton ¶
func (lin *Linweb) AddSingleton(objs ...interface{})
AddSingleton Add objects to DI container with a single instance in every request, they must all be of pointer type.
func (*Linweb) AddTransient ¶
func (lin *Linweb) AddTransient(objs ...interface{})
AddTransient Add objects to DI container with new instance in every request, they must all be of pointer type.