Documentation
¶
Index ¶
- Constants
- func GetComponent[T IComponent](c *Context) T
- func GetFilter[T IFilter](c *Context) T
- func GetModel[T IModel](c *Context) T
- func GetReNewModel[T IModel](db *db.DB, c *Context) T
- func GetRunner[T IRunner](c *Context) T
- func GetService[T IService](c *Context) T
- func UnmarshalKeyConfig[T any](key string, c *Context) (T, error)
- type Context
- func (c *Context) AddComponent(components ...IComponent)
- func (c *Context) AddModel(model ...IModel)
- func (c *Context) AddModelGroup(modelGroup ...IModelGroup)
- func (c *Context) AddRunner(runner ...IRunner)
- func (c *Context) AddService(services ...IService)
- func (c *Context) Any(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
- func (c *Context) CertManager() *web.CertManager
- func (c *Context) Copy(handlerConfig *web.HandlerConfig, filters []IFilter) *Context
- func (c *Context) DefaultModelGroup() IModelGroup
- func (c *Context) Delete(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
- func (c *Context) Get(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
- func (c *Context) GetComponent(f func(m IComponent) bool) IComponent
- func (c *Context) GetConfig() config2.IConfig
- func (c *Context) GetFilter(f func(m IFilter) bool) IFilter
- func (c *Context) GetModel(f func(m IModel) bool) IModel
- func (c *Context) GetModelGroup(name string) IModelGroup
- func (c *Context) GetRunner(f func(m IRunner) bool) IRunner
- func (c *Context) GetService(f func(m IService) bool) IService
- func (c *Context) GetTransaction() *model.Transaction
- func (c *Context) Go(f func(c *Context))
- func (c *Context) Post(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
- func (c *Context) Put(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
- type IComponent
- type IConverter
- type IFilter
- type IModel
- type IModelGroup
- type IRest
- type IRun
- type IRunner
- type IService
- type ModelGroup
- func (m *ModelGroup) AddModel(model ...IModel)
- func (m *ModelGroup) AutoCreateTable(autoCreateTable bool)
- func (m *ModelGroup) GetModel() []IModel
- func (m *ModelGroup) GetTransaction() *model.Transaction
- func (m *ModelGroup) Init(context *Context) error
- func (m *ModelGroup) Name() string
- func (m *ModelGroup) SetDefaultDB(db *db.DB)
- func (m *ModelGroup) SwitchDB(db *db.DB, context *Context) error
- type RestGroup
- type Server
Constants ¶
View Source
const DefaultName = "DefaultName"
Variables ¶
This section is empty.
Functions ¶
func GetComponent ¶ added in v0.0.4
func GetComponent[T IComponent](c *Context) T
func GetService ¶ added in v0.1.1
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶ added in v0.1.2
func NewContext(config config2.IConfig, defaultModelGroup IModelGroup) *Context
func (*Context) AddComponent ¶ added in v0.1.2
func (c *Context) AddComponent(components ...IComponent)
func (*Context) AddModelGroup ¶ added in v0.1.3
func (c *Context) AddModelGroup(modelGroup ...IModelGroup)
func (*Context) AddService ¶
func (*Context) Any ¶ added in v0.1.2
func (c *Context) Any(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
func (*Context) CertManager ¶ added in v0.1.3
func (c *Context) CertManager() *web.CertManager
func (*Context) Copy ¶
func (c *Context) Copy(handlerConfig *web.HandlerConfig, filters []IFilter) *Context
func (*Context) DefaultModelGroup ¶ added in v0.1.3
func (c *Context) DefaultModelGroup() IModelGroup
func (*Context) Delete ¶ added in v0.1.2
func (c *Context) Delete(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
func (*Context) Get ¶
func (c *Context) Get(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
func (*Context) GetComponent ¶ added in v0.0.4
func (c *Context) GetComponent(f func(m IComponent) bool) IComponent
func (*Context) GetModelGroup ¶ added in v0.1.3
func (c *Context) GetModelGroup(name string) IModelGroup
func (*Context) GetTransaction ¶
func (c *Context) GetTransaction() *model.Transaction
func (*Context) Post ¶
func (c *Context) Post(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
func (*Context) Put ¶ added in v0.1.2
func (c *Context) Put(relativePath string, handlers ...web.HandlerFunc) *web.HandlerInfo
type IComponent ¶ added in v0.0.4
type IConverter ¶ added in v0.1.3
type IModelGroup ¶ added in v0.1.3
type ModelGroup ¶ added in v0.1.3
type ModelGroup struct {
// contains filtered or unexported fields
}
func DefaultModelGroup ¶ added in v0.1.3
func DefaultModelGroup() *ModelGroup
func EmptyModelGroup ¶ added in v0.1.3
func EmptyModelGroup(name string) *ModelGroup
func NewModelGroup ¶ added in v0.1.3
func NewModelGroup(db *db.DB, name string) *ModelGroup
func (*ModelGroup) AddModel ¶ added in v0.1.3
func (m *ModelGroup) AddModel(model ...IModel)
func (*ModelGroup) AutoCreateTable ¶ added in v0.1.4
func (m *ModelGroup) AutoCreateTable(autoCreateTable bool)
func (*ModelGroup) GetModel ¶ added in v0.1.3
func (m *ModelGroup) GetModel() []IModel
func (*ModelGroup) GetTransaction ¶ added in v0.1.3
func (m *ModelGroup) GetTransaction() *model.Transaction
func (*ModelGroup) Init ¶ added in v0.1.3
func (m *ModelGroup) Init(context *Context) error
func (*ModelGroup) Name ¶ added in v0.1.3
func (m *ModelGroup) Name() string
func (*ModelGroup) SetDefaultDB ¶ added in v0.1.4
func (m *ModelGroup) SetDefaultDB(db *db.DB)
type RestGroup ¶
type RestGroup struct {
// contains filtered or unexported fields
}
func NewRestGroup ¶
func NewRestGroup(serverConfig *web.ServerConfig, converter IConverter, handles *web.Handles) *RestGroup
func (*RestGroup) Converter ¶ added in v0.1.3
func (rg *RestGroup) Converter(converter IConverter) *RestGroup
Click to show internal directories.
Click to hide internal directories.