core

package
v0.0.0-...-fbd1cd9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppService

func AppService[T Service](app *App) (T, error)

func Gen

func Gen(genType string, specificPath string, overwrite bool)

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 NewApp

func NewApp(conf *config.Config) *App

func (*App) Bootstrap

func (app *App) Bootstrap() error

Bootstrap implements App.

func (*App) Cache

func (app *App) Cache() *cache.Cache

func (*App) Conf

func (app *App) Conf() *config.Config

func (*App) ConfTpl

func (app *App) ConfTpl() string

func (*App) Dao

func (app *App) Dao() *dao.Dao

func (*App) Inject

func (app *App) Inject(name string, service Service)

func (*App) OnConfUpdated

func (app *App) OnConfUpdated() *hook.Hook[*ConfUpdatedEvent]

func (*App) OnTerminate

func (app *App) OnTerminate() *hook.Hook[*TerminateEvent]

func (*App) ResetBootstrapState

func (app *App) ResetBootstrapState() error

func (*App) Restart

func (app *App) Restart() error

func (*App) Service

func (app *App) Service(name string) (Service, error)

func (*App) SetConf

func (app *App) SetConf(conf *config.Config)

func (*App) SetDao

func (app *App) SetDao(dao *dao.Dao)

type BootstrapEvent

type BootstrapEvent struct {
	App *App
}

type ConfUpdatedEvent

type ConfUpdatedEvent struct {
	App  *App
	Conf *config.Config
}

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

func (*NotifyService) Push

func (s *NotifyService) Push(comment *entity.Comment, pComment *entity.Comment) error

type Service

type Service interface {
	Init() error
	Dispose() error
}

type TerminateEvent

type TerminateEvent struct {
	App *App
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL