authorize

package
v0.0.0-...-80b3c92 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decoding

func Base64Decoding(raw string) string

base64解码

func Base64Encoding

func Base64Encoding(raw string) string

base64编码,去掉 =

func Sha1Str

func Sha1Str(raw string) string

SHA1加密

Types

type FileAuthorize

type FileAuthorize struct {
	// contains filtered or unexported fields
}

func (*FileAuthorize) GetAllAccounts

func (f *FileAuthorize) GetAllAccounts() map[string]User

func (*FileAuthorize) GetToken

func (f *FileAuthorize) GetToken(name string, pwd string) (string, error)

func (*FileAuthorize) VerifyToken

func (f *FileAuthorize) VerifyToken(token string) error

校验token

type IAuthorize

type IAuthorize interface {
	GetAllAccounts() map[string]User
	GetToken(name string, pwd string) (string, error) //获取访问token
	VerifyToken(token string) error                   //校验token
}

func NewAuthorize

func NewAuthorize(context *context.Context) IAuthorize

type User

type User struct {
	Name    string //用户名
	Pwd     string //密码
	AuthKey string //授权key
}

Jump to

Keyboard shortcuts

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