global

package
v0.0.0-...-5d42812 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errors = CustomErrors{
	BusinessError: CustomError{40000, "业务错误"},
	ValidateError: CustomError{42200, "请求参数错误"},
	TokenError:    CustomError{40100, "登录授权失效"},
	OtherError:    CustomError{40200, "其他错误码"},
}

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
}

type CustomErrors

type CustomErrors struct {
	BusinessError CustomError
	ValidateError CustomError
	TokenError    CustomError
	OtherError    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