accesstoken

package
v0.0.0-...-d92beae Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	AppID       int64
	UserID      int64
	AccessToken string `json:"access_token"`
	Expires     int64  `json:"expires"`
}

Token is the object for returning the token information.

func GetNewAccessToken

func GetNewAccessToken(userID int64) Token

GetNewAccessToken is a function to generate a new access token.

func (*Token) CreateToken

func (token *Token) CreateToken() resterrors.RestErr

CreateToken is a method to create the token.

func (*Token) FindByAccessToken

func (tk *Token) FindByAccessToken() resterrors.RestErr

FindByAccessToken the access token from the database or return a RestErr.

func (*Token) FindByAppUser

func (tk *Token) FindByAppUser() resterrors.RestErr

FindByAppUser the access token from the database or return a RestErr.

func (Token) IsExpired

func (token Token) IsExpired() bool

IsExpired is a method to verify if the access token is expired or not.

func (*Token) Save

func (tk *Token) Save() resterrors.RestErr

Save the access token in the database or return the RestErr.

func (*Token) Validate

func (token *Token) Validate() resterrors.RestErr

Validate is a method to validate the AccessToken.

Jump to

Keyboard shortcuts

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