global

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

* @Author: alexander.huang * @Date: 2022-05-19 03:10:11 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-18 03:10:11

* @Author: alexander.huang * @Date: 2022-05-19 01:14:50 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-23 21:40:51

Index

Constants

This section is empty.

Variables

View Source
var Errors = CustomErrors{
	BusinessError: CustomError{40000, "业务错误"},
	ValidateError: CustomError{42200, "请求参数错误"},
	TokenError:    CustomError{40100, "登陆授权失败"},
	FavoriteError: CustomError{40200, "点赞失败"},
}
View Source
var NowUserID uint64

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
}

Store variables when the project is started

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
	FavoriteError 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