goio

package
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

go.io

framework interfaces and configurations for libraries

Documentation

Index

Constants

View Source
const ERROR_DATABASE int64 = 555
View Source
const ERROR_FORBIDDEN int64 = 403
View Source
const ERROR_INVALID int64 = -1
View Source
const ERROR_NOTFOUND int64 = 404
View Source
const ERROR_PARAMS int64 = 700
View Source
const ERROR_REDIS int64 = 556
View Source
const ERROR_REQUEST int64 = 400

client

View Source
const ERROR_SERVER int64 = 500

server

View Source
const ERROR_UNAUTHORIZED int64 = 401
View Source
const SUCCESS_REQUEST = 0

Variables

View Source
var (
	Version     string
	VersionFlag = flag.Bool("v", false, "version")

	HelpFlag = flag.Bool("h", false, "help")
)

Functions

func CreateToken added in v1.0.17

func CreateToken(appId string, openId string) (tokenStr string, err error)

func FlagInit added in v1.0.13

func FlagInit()

func Init added in v1.0.14

func Init(env Environment)

Types

type Environment added in v1.0.15

type Environment string
const (
	PRODUCTION  Environment = "pro"
	PRE         Environment = "pre"
	RT          Environment = "rt"
	TEST        Environment = "test"
	DEVELOPMENT Environment = "dev"
)

库运行模式 dev|test|rt|pre|pro go-zero

var Env Environment //string `json:",default=pro,options=dev|test|rt|pre|pro"`

当前运行环境

func (Environment) String added in v1.0.15

func (env Environment) String() string

func (Environment) Tag added in v1.0.15

func (env Environment) Tag() string

type Token added in v1.0.17

type Token struct {
	AppId     string
	OpenId    string
	NonceStr  string
	Timestamp int64
}

生成 Token 验证Token

func ParseToken added in v1.0.17

func ParseToken(tokenStr, appId string) (token *Token, err error)

func (*Token) Bytes added in v1.0.17

func (t *Token) Bytes() []byte

func (*Token) String added in v1.0.17

func (t *Token) String() string

Jump to

Keyboard shortcuts

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