encode

package
v0.0.0-...-7c3836c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRoute      = errors.New("bad route")
	ErrToken         = errors.New("Token 失效, 请重新登陆")
	ErrParamsRefused = errors.New("参数校验未通过")
	ErrCasbin        = errors.New("您无权访问该模块,请联系管理员添加权限")
)

Functions

func EncodeError

func EncodeError(_ context.Context, err error, w http.ResponseWriter)

func EncodePassword

func EncodePassword(password string, salt string) string

func EncodeResponse

func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

func EncodeTemplate

func EncodeTemplate(name string, tempContent string, paramContent interface{}) (string, error)

func HashString

func HashString(byte []byte) string

func PBKDF2

func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte

http://code.google.com/p/go/source/browse/pbkdf2/pbkdf2.go?repo=crypto

func String

func String(n int32) string

Types

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data,omitempty"`
	Err  error       `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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