Documentation
¶
Index ¶
- func GetComponent[T IComponent](c *Context) T
- func GetModel[T IModel](c *Context) T
- func GetReNewModel[T IModel](db *gorm.DB, c *Context) T
- func GetRunner[T IRunner](c *Context) T
- func GetService[T IService](c *Context) T
- func UnmarshalConfig[T any](key string, c *Context) T
- type Context
- func (c *Context) AddComponent(components ...IComponent)
- func (c *Context) AddModel(model ...IModel)
- func (c *Context) AddRunner(runner ...IRunner)
- func (c *Context) AddService(services ...IService)
- func (c *Context) Any(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) AnyAuth(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) AnyRaw(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) AnyRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) Copy(digestAuth *web.DigestAuth, httpServer *web.HttpServer) *Context
- func (c *Context) Delete(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) DeleteAuth(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) DeleteRaw(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) DeleteRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) Get(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) GetAuth(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) GetComponent(f func(m IComponent) bool) IComponent
- func (c *Context) GetConfig() config2.IConfig
- func (c *Context) GetDB() *gorm.DB
- func (c *Context) GetModel(f func(m IModel) bool) IModel
- func (c *Context) GetRaw(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) GetRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) GetRunner(f func(m IRunner) bool) IRunner
- func (c *Context) GetSchedule() *Schedule
- func (c *Context) GetService(f func(m IService) bool) IService
- func (c *Context) GetTransaction() *model.Transaction
- func (c *Context) Handle(httpMethod, relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) HandleAuth(httpMethod, relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) HandleRaw(httpMethod, relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) HandleRawAuth(httpMethod, relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) Post(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) PostAuth(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) PostRaw(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) PostRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) Put(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) PutAuth(relativePath string, handlers ...web.HandlerFunc)
- func (c *Context) PutRaw(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) PutRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
- func (c *Context) Use(middlewareFunc ...MiddlewareFunc)
- type IComponent
- type IDestroy
- type IModel
- type IRest
- type IRunner
- type IService
- type Info
- type MiddlewareFunc
- type RestGroup
- func (rg *RestGroup) AddMiddlewares(middlewareFunc ...MiddlewareFunc) *RestGroup
- func (rg *RestGroup) AddRest(rest ...IRest) *RestGroup
- func (rg *RestGroup) Authentication(authentication web.Authentication) *RestGroup
- func (rg *RestGroup) DigestAuth() *web.DigestAuth
- func (rg *RestGroup) Merge(restGroup *RestGroup) *RestGroup
- func (rg *RestGroup) Port() int
- type RouteInfo
- type RouteTree
- type Schedule
- func (c *Schedule) AddFunc(spec string, cmd func()) (cron.EntryID, error)
- func (c *Schedule) AddIdOrReplaceKeyFunc(id uint, key string, spec string, cmd func()) (cron.EntryID, bool, error)
- func (c *Schedule) AddKeyFunc(key string, spec string, cmd func()) (cron.EntryID, bool, error)
- func (c *Schedule) Destroy() error
- func (c *Schedule) Init(config config2.IConfig) error
- func (c *Schedule) Name() string
- func (c *Schedule) ReplaceKeyFunc(key string, spec string, cmd func()) (cron.EntryID, error)
- func (c *Schedule) Run() error
- func (c *Schedule) StopIdFunc(id uint)
- func (c *Schedule) StopKeyFunc(key string)
- type ScheduleConfig
- type Server
Constants ¶
This section is empty.
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
func UnmarshalConfig ¶ added in v0.1.2
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶ added in v0.1.2
func (*Context) AddComponent ¶ added in v0.1.2
func (c *Context) AddComponent(components ...IComponent)
func (*Context) AddService ¶
func (*Context) Any ¶ added in v0.1.2
func (c *Context) Any(relativePath string, handlers ...web.HandlerFunc)
func (*Context) AnyAuth ¶ added in v0.1.2
func (c *Context) AnyAuth(relativePath string, handlers ...web.HandlerFunc)
func (*Context) AnyRaw ¶ added in v0.1.2
func (c *Context) AnyRaw(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) AnyRawAuth ¶ added in v0.1.2
func (c *Context) AnyRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) Copy ¶
func (c *Context) Copy(digestAuth *web.DigestAuth, httpServer *web.HttpServer) *Context
func (*Context) Delete ¶ added in v0.1.2
func (c *Context) Delete(relativePath string, handlers ...web.HandlerFunc)
func (*Context) DeleteAuth ¶ added in v0.1.2
func (c *Context) DeleteAuth(relativePath string, handlers ...web.HandlerFunc)
func (*Context) DeleteRaw ¶ added in v0.1.2
func (c *Context) DeleteRaw(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) DeleteRawAuth ¶ added in v0.1.2
func (c *Context) DeleteRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) GetAuth ¶
func (c *Context) GetAuth(relativePath string, handlers ...web.HandlerFunc)
func (*Context) GetComponent ¶ added in v0.0.4
func (c *Context) GetComponent(f func(m IComponent) bool) IComponent
func (*Context) GetRaw ¶
func (c *Context) GetRaw(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) GetRawAuth ¶
func (c *Context) GetRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) GetSchedule ¶ added in v0.1.1
func (*Context) GetTransaction ¶
func (c *Context) GetTransaction() *model.Transaction
func (*Context) Handle ¶ added in v0.1.2
func (c *Context) Handle(httpMethod, relativePath string, handlers ...web.HandlerFunc)
func (*Context) HandleAuth ¶ added in v0.1.2
func (c *Context) HandleAuth(httpMethod, relativePath string, handlers ...web.HandlerFunc)
func (*Context) HandleRaw ¶ added in v0.1.2
func (c *Context) HandleRaw(httpMethod, relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) HandleRawAuth ¶ added in v0.1.2
func (c *Context) HandleRawAuth(httpMethod, relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) PostAuth ¶
func (c *Context) PostAuth(relativePath string, handlers ...web.HandlerFunc)
func (*Context) PostRaw ¶
func (c *Context) PostRaw(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) PostRawAuth ¶
func (c *Context) PostRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) Put ¶ added in v0.1.2
func (c *Context) Put(relativePath string, handlers ...web.HandlerFunc)
func (*Context) PutAuth ¶ added in v0.1.2
func (c *Context) PutAuth(relativePath string, handlers ...web.HandlerFunc)
func (*Context) PutRaw ¶ added in v0.1.2
func (c *Context) PutRaw(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) PutRawAuth ¶ added in v0.1.2
func (c *Context) PutRawAuth(relativePath string, handlers ...web.HandlerRawFunc)
func (*Context) Use ¶ added in v0.1.2
func (c *Context) Use(middlewareFunc ...MiddlewareFunc)
type IComponent ¶ added in v0.0.4
type MiddlewareFunc ¶ added in v0.1.2
type RestGroup ¶
type RestGroup struct {
// contains filtered or unexported fields
}
func NewRestGroup ¶
func NewRestGroup(serverConfig *web.ServerConfig) *RestGroup
func (*RestGroup) AddMiddlewares ¶ added in v0.1.2
func (rg *RestGroup) AddMiddlewares(middlewareFunc ...MiddlewareFunc) *RestGroup
func (*RestGroup) Authentication ¶
func (rg *RestGroup) Authentication(authentication web.Authentication) *RestGroup
func (*RestGroup) DigestAuth ¶ added in v0.1.2
func (rg *RestGroup) DigestAuth() *web.DigestAuth
type Schedule ¶ added in v0.1.1
type Schedule struct {
// contains filtered or unexported fields
}
func NewSchedule ¶ added in v0.1.1
func NewSchedule() *Schedule
func (*Schedule) AddIdOrReplaceKeyFunc ¶ added in v0.1.1
func (*Schedule) AddKeyFunc ¶ added in v0.1.1
func (*Schedule) ReplaceKeyFunc ¶ added in v0.1.1
func (*Schedule) StopIdFunc ¶ added in v0.1.1
func (*Schedule) StopKeyFunc ¶ added in v0.1.1
type ScheduleConfig ¶ added in v0.1.1
type ScheduleConfig struct {
Enable bool
}
func (*ScheduleConfig) Key ¶ added in v0.1.1
func (c *ScheduleConfig) Key() string
Click to show internal directories.
Click to hide internal directories.