access_token

package
v0.0.0-...-276c4df Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Access_Token string `json:"access_token"`
	UserId       int64  `json:"user_id"`
	ClientId     int64  `json:"client_id"`
	Expires      int64  `json:"expires"`
}

ACCESS TOKEN

func GetNewAccessToken

func GetNewAccessToken(userId int64) AccessToken

func (*AccessToken) Generate

func (at *AccessToken) Generate()

func (*AccessToken) IsExpired

func (AT *AccessToken) IsExpired() bool

func (*AccessToken) Validate

func (at *AccessToken) Validate() *errors.RestErr

type AccessTokenRequest

type AccessTokenRequest struct {
	GrantType string `json:"grant_type"`
	Scope     string `json:"scope"`

	//Used for password grant type
	UserName string `json:"username"`
	Password string `json:"password"`

	//Used for client credentials
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

ACCESS TOKEN REQUEST

func (*AccessTokenRequest) Validate

func (atr *AccessTokenRequest) Validate() *errors.RestErr

Jump to

Keyboard shortcuts

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