global

package
v0.0.0-...-0a681d7 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errors = CustomErrors{
	BusinessError:       CustomError{40000, "业务错误"},
	ValidateError:       CustomError{40001, "请求参数错误"},
	TokenError:          CustomError{40002, "登录授权失效"},
	CodeDuplicateError:  CustomError{40003, "编号重复错误"},
	NameDuplicateError:  CustomError{40004, "名称重复错误"},
	RecordNotFoundError: CustomError{40005, "记录未找到错误"},
	MobileExistedError:  CustomError{40006, "手机号已存在"},
}

Functions

This section is empty.

Types

type Application

type Application struct {
	ConfigViper *viper.Viper
	Config      config.Configuration
	Log         *zap.Logger
	DB          *gorm.DB
	Redis       *redis.Client
	Cron        *cron.Cron
}

func (*Application) Disk

func (app *Application) Disk(disk ...string) storage.Storage

type CustomError

type CustomError struct {
	ErrorCode int
	ErrorMsg  string
}

func (CustomError) Error

func (err CustomError) Error() string

type CustomErrors

type CustomErrors struct {
	BusinessError       CustomError
	ValidateError       CustomError
	TokenError          CustomError
	CodeDuplicateError  CustomError
	NameDuplicateError  CustomError
	RecordNotFoundError CustomError
	MobileExistedError  CustomError
}

type Interface

type Interface interface {
	Get() bool
	Block(seconds int64) bool
	Release() bool
	ForceRelease()
}

func Lock

func Lock(name string, seconds int64) Interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳