Documentation ¶
Index ¶
- func AppInject[T Service](app *App, service T)
- func AppService[T Service](app *App) (T, error)
- func Gen(genType string, specificPath string, overwrite bool)
- type AntiSpamCheckPayload
- type AntiSpamService
- type App
- func (app *App) Bootstrap() error
- func (app *App) Cache() *cache.Cache
- func (app *App) Conf() *config.Config
- func (app *App) ConfTpl() string
- func (app *App) Dao() *dao.Dao
- func (app *App) Inject(name string, service Service)
- func (app *App) OnConfUpdated() *hook.Hook[*ConfUpdatedEvent]
- func (app *App) OnTerminate() *hook.Hook[*TerminateEvent]
- func (app *App) ResetBootstrapState() error
- func (app *App) Restart() error
- func (app *App) Service(name string) (Service, error)
- func (app *App) SetConf(conf *config.Config)
- func (app *App) SetDao(dao *dao.Dao)
- type BootstrapEvent
- type ConfUpdatedEvent
- type EmailService
- type IPRegionService
- type NotifyService
- type Service
- type TerminateEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppInject ¶
@see https://github.com/golang/go/issues/55006 @see https://github.com/golang/go/issues/49085
func AppService ¶
Types ¶
type AntiSpamCheckPayload ¶
type AntiSpamCheckPayload struct { Comment *entity.Comment ReqReferer string ReqIP string ReqUserAgent string }
Payload for CheckAndBlock function
type AntiSpamService ¶
type AntiSpamService struct {
// contains filtered or unexported fields
}
func NewAntiSpamService ¶
func NewAntiSpamService(app *App) *AntiSpamService
func (*AntiSpamService) CheckAndBlock ¶
func (s *AntiSpamService) CheckAndBlock(data *AntiSpamCheckPayload)
func (*AntiSpamService) Dispose ¶
func (s *AntiSpamService) Dispose() error
func (*AntiSpamService) Init ¶
func (s *AntiSpamService) Init() error
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) OnConfUpdated ¶
func (app *App) OnConfUpdated() *hook.Hook[*ConfUpdatedEvent]
func (*App) OnTerminate ¶
func (app *App) OnTerminate() *hook.Hook[*TerminateEvent]
func (*App) ResetBootstrapState ¶
type BootstrapEvent ¶
type BootstrapEvent struct {
App *App
}
type ConfUpdatedEvent ¶
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
func NewEmailService ¶
func NewEmailService(app *App) *EmailService
func (*EmailService) AsyncSend ¶
func (e *EmailService) AsyncSend(notify *entity.Notify)
func (*EmailService) AsyncSendTo ¶
func (e *EmailService) AsyncSendTo(subject string, body string, toAddr string)
func (*EmailService) Dispose ¶
func (e *EmailService) Dispose() error
func (*EmailService) GetRenderer ¶
func (e *EmailService) GetRenderer(useAdminTplParam ...bool) *template.Renderer
func (*EmailService) Init ¶
func (e *EmailService) Init() error
type IPRegionService ¶
type IPRegionService struct {
// contains filtered or unexported fields
}
func NewIPRegionService ¶
func NewIPRegionService(app *App) *IPRegionService
func (*IPRegionService) Dispose ¶
func (s *IPRegionService) Dispose() error
func (*IPRegionService) Init ¶
func (s *IPRegionService) Init() error
func (*IPRegionService) Query ¶
func (s *IPRegionService) Query(ip string) string
type NotifyService ¶
type NotifyService struct {
// contains filtered or unexported fields
}
func NewNotifyService ¶
func NewNotifyService(app *App) *NotifyService
func (*NotifyService) Dispose ¶
func (s *NotifyService) Dispose() error
func (*NotifyService) Init ¶
func (s *NotifyService) Init() error
type TerminateEvent ¶
type TerminateEvent struct {
App *App
}
Click to show internal directories.
Click to hide internal directories.