token

package
v0.0.0-...-fa3d426 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountActivationURL

func AccountActivationURL(user *models.User) string

AccountActivationURL generate a token for user account activation

func SigningKey

func SigningKey() []byte

SigningKey returns the secret key setting

Types

type Token

type Token struct {
	Kind       string
	Value      interface{}
	Expiration int64
}

Token represents a JWT token

func Decode

func Decode(encoded string) *Token

Decode decodes token

func NewToken

func NewToken(kind string, value interface{}) *Token

NewToken instanciates a new Token

func (*Token) AccountValidationUser

func (token *Token) AccountValidationUser() string

AccountValidationUser returns user id from token

func (*Token) Encode

func (token *Token) Encode() string

Encode encodes token

func (*Token) ExpirationTime

func (token *Token) ExpirationTime() time.Time

ExpirationTime returns tokenb expiration time

func (*Token) Expired

func (token *Token) Expired() bool

Expired returns true if token expired

func (*Token) SetExpirationTime

func (token *Token) SetExpirationTime(exp time.Time)

SetExpirationTime sets expiration time on token

Jump to

Keyboard shortcuts

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