token

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(userId string) bool

Check if the given user has already stored his token

Types

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

type ResfreshTokenConfig

type ResfreshTokenConfig struct {
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

type Token

type Token struct {
	UserId       string `json:"-"`
	RefreshToken string `json:"-"`
}

The feed

func Get

func Get(userId string) *Token

Get the Novel given an novelId

func GetByAccessToken

func GetByAccessToken(accessToken string) *Token

Get the Novel given an novelId

func New

func New() *Token

Instanciate a new feed

func (*Token) Refresh

func (t *Token) Refresh() bool

Refresh the given token

func (*Token) Save

func (token *Token) Save()

Save the token in the database

func (Token) String

func (t Token) String() string

func (*Token) Update

func (t *Token) Update()

Update the token

Jump to

Keyboard shortcuts

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