linktoken

package
Version: v0.0.0-...-cea2754 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLinkToken = errors.New("link token invalid")
)

Functions

This section is empty.

Types

type ActivationTokenData

type ActivationTokenData struct {
	ActivateUser int `json:"activateUser"`
}

func (*ActivationTokenData) MarshalJSON

func (d *ActivationTokenData) MarshalJSON() ([]byte, error)

func (*ActivationTokenData) UnmarshalJSON

func (d *ActivationTokenData) UnmarshalJSON(data []byte) error

type EmailActivationTokenData

type EmailActivationTokenData struct {
	ActivateEmail string `json:"activate_email"`
}

func (*EmailActivationTokenData) MarshalJSON

func (d *EmailActivationTokenData) MarshalJSON() ([]byte, error)

func (*EmailActivationTokenData) UnmarshalJSON

func (d *EmailActivationTokenData) UnmarshalJSON(data []byte) error

type LinkToken

type LinkToken struct {
	Data    TokenData `json:"data"`
	Expires int       `json:"expires"`
}

func NewLinkToken

func NewLinkToken(data TokenData, expires int) *LinkToken

type RequestTokenData

type RequestTokenData struct {
	Request int `json:"request"`
}

func (*RequestTokenData) MarshalJSON

func (d *RequestTokenData) MarshalJSON() ([]byte, error)

func (*RequestTokenData) UnmarshalJSON

func (d *RequestTokenData) UnmarshalJSON(data []byte) error

type TokenCodec

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

func NewTokenCodec

func NewTokenCodec(keyVersion int, key string) *TokenCodec

func (*TokenCodec) DecodeToken

func (c *TokenCodec) DecodeToken(tokenString string, tokenData TokenData) (*LinkToken, error)

func (*TokenCodec) EncodeToken

func (c *TokenCodec) EncodeToken(token *LinkToken) (string, error)

type TokenData

type TokenData interface {
	json.Marshaler
	json.Unmarshaler
}

type UserTokenData

type UserTokenData struct {
	User int `json:"user"`
}

func (*UserTokenData) MarshalJSON

func (d *UserTokenData) MarshalJSON() ([]byte, error)

func (*UserTokenData) UnmarshalJSON

func (d *UserTokenData) UnmarshalJSON(data []byte) error

Source Files

Jump to

Keyboard shortcuts

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