Documentation ¶ Index ¶ func BuildHash(t *Token, appKey string) string func Validate(token *Token, appKey string) (int32, bool) type Token func DecodeToken(base64Token string) (*Token, bool) func New(pid int32, openId string, appKey string) *Token func (t *Token) ToBase64() string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func BuildHash ¶ func BuildHash(t *Token, appKey string) string func Validate ¶ func Validate(token *Token, appKey string) (int32, bool) Types ¶ type Token ¶ type Token struct { PID int32 `json:"pid"` OpenID string `json:"open_id"` Timestamp int64 `json:"tt"` Hash string `json:"hash"` } func DecodeToken ¶ func DecodeToken(base64Token string) (*Token, bool) func New ¶ func New(pid int32, openId string, appKey string) *Token func (*Token) ToBase64 ¶ func (t *Token) ToBase64() string Source Files ¶ View all Source files token.go Click to show internal directories. Click to hide internal directories.