Documentation ¶
Index ¶
- Constants
- Variables
- func AtoISlice(originSlice []string) (strSlice []int, err error)
- func CreateSlice[T int | string | interface{}](length int, value T) []T
- func ItoaSlice(originSlice []int) []string
- func NewSettings() (s settings, err error)
- func NewTmplManager(name string) *tmplManager
- func P(err error)
- func PanicErr(message string, code int)
- type App
- func (app *App) AddSubcommand(cmd *cli.Command)
- func (app *App) HTML(w http.ResponseWriter, tmplName string, data any) error
- func (app *App) InitCache() error
- func (app *App) InitORM() error
- func (app *App) InitOSS() error
- func (app *App) InitSetting() error
- func (app *App) InitTmpl() error
- func (app *App) InitTokenAuth()
- func (app *App) InitValidator()
- func (app *App) IsDev() bool
- func (app *App) JSON(w http.ResponseWriter, data any) error
- func (app *App) Run() error
- type AtomicLock
- type Cache
- type Err
- type SystemSet
- type Validator
Constants ¶
View Source
const ( ErrCodeDefault = 100 ErrCodeLoginFailed = 101 ErrCodeFrequentRequests = 102 )
View Source
const FTS_SEARCH_END_IDX = "☾†🔮☽"
View Source
const FTS_SEARCH_START_IDX = "☾🔮☽"
Variables ¶
View Source
var FtsSearchIdxLen = len(FTS_SEARCH_START_IDX) + len(FTS_SEARCH_END_IDX)
Functions ¶
func CreateSlice ¶
CreateSlice 创建指定长度并初始化为相同值的切片
func NewSettings ¶
func NewSettings() (s settings, err error)
func NewTmplManager ¶
func NewTmplManager(name string) *tmplManager
Types ¶
type App ¶
type App struct { RootCmd *cli.App O *orm Settings *settings TokenAuth *jwtauth.JWTAuth OssClient *oss Cache Cache TmplManager *tmplManager Validator *Validator }
func (*App) AddSubcommand ¶
func (app *App) AddSubcommand(cmd *cli.Command)
func (*App) InitSetting ¶
func (*App) InitTokenAuth ¶
func (app *App) InitTokenAuth()
func (*App) InitValidator ¶
func (app *App) InitValidator()
type AtomicLock ¶
type AtomicLock struct {
// contains filtered or unexported fields
}
简单的 CAS 机制锁
func (*AtomicLock) TryLock ¶
func (l *AtomicLock) TryLock() bool
func (*AtomicLock) Unlock ¶
func (l *AtomicLock) Unlock()
type Cache ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.