models

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID     string
	Secret string
	Domain string
	UserID string
}

Client client model

func (*Client) GetDomain

func (c *Client) GetDomain() string

GetDomain client domain

func (*Client) GetID

func (c *Client) GetID() string

GetID client id

func (*Client) GetSecret

func (c *Client) GetSecret() string

GetSecret client secret

func (*Client) GetUserID

func (c *Client) GetUserID() string

GetUserID user id

type Token

type Token struct {
	ClientID            string        `bson:"ClientID"`
	UserID              string        `bson:"UserID"`
	RedirectURI         string        `bson:"RedirectURI"`
	Scope               string        `bson:"Scope"`
	Code                string        `bson:"Code"`
	CodeChallenge       string        `bson:"CodeChallenge"`
	CodeChallengeMethod string        `bson:"CodeChallengeMethod"`
	CodeCreateAt        time.Time     `bson:"CodeCreateAt"`
	CodeExpiresIn       time.Duration `bson:"CodeExpiresIn"`
	Access              string        `bson:"Access"`
	AccessCreateAt      time.Time     `bson:"AccessCreateAt"`
	AccessExpiresIn     time.Duration `bson:"AccessExpiresIn"`
	Refresh             string        `bson:"Refresh"`
	RefreshCreateAt     time.Time     `bson:"RefreshCreateAt"`
	RefreshExpiresIn    time.Duration `bson:"RefreshExpiresIn"`
}

Token token model

func NewToken

func NewToken() *Token

NewToken create to token model instance

func (*Token) GetAccess

func (t *Token) GetAccess() string

GetAccess access Token

func (*Token) GetAccessCreateAt

func (t *Token) GetAccessCreateAt() time.Time

GetAccessCreateAt create Time

func (*Token) GetAccessExpiresIn

func (t *Token) GetAccessExpiresIn() time.Duration

GetAccessExpiresIn the lifetime in seconds of the access token

func (*Token) GetClientID

func (t *Token) GetClientID() string

GetClientID the client id

func (*Token) GetCode

func (t *Token) GetCode() string

GetCode authorization code

func (*Token) GetCodeChallenge

func (t *Token) GetCodeChallenge() string

GetCodeChallenge challenge code

func (*Token) GetCodeChallengeMethod

func (t *Token) GetCodeChallengeMethod() oauth2.CodeChallengeMethod

GetCodeChallengeMethod challenge method

func (*Token) GetCodeCreateAt

func (t *Token) GetCodeCreateAt() time.Time

GetCodeCreateAt create Time

func (*Token) GetCodeExpiresIn

func (t *Token) GetCodeExpiresIn() time.Duration

GetCodeExpiresIn the lifetime in seconds of the authorization code

func (*Token) GetRedirectURI

func (t *Token) GetRedirectURI() string

GetRedirectURI redirect URI

func (*Token) GetRefresh

func (t *Token) GetRefresh() string

GetRefresh refresh Token

func (*Token) GetRefreshCreateAt

func (t *Token) GetRefreshCreateAt() time.Time

GetRefreshCreateAt create Time

func (*Token) GetRefreshExpiresIn

func (t *Token) GetRefreshExpiresIn() time.Duration

GetRefreshExpiresIn the lifetime in seconds of the refresh token

func (*Token) GetScope

func (t *Token) GetScope() string

GetScope get scope of authorization

func (*Token) GetUserID

func (t *Token) GetUserID() string

GetUserID the user id

func (*Token) New

func (t *Token) New() oauth2.TokenInfo

New create to token model instance

func (*Token) SetAccess

func (t *Token) SetAccess(access string)

SetAccess access Token

func (*Token) SetAccessCreateAt

func (t *Token) SetAccessCreateAt(createAt time.Time)

SetAccessCreateAt create Time

func (*Token) SetAccessExpiresIn

func (t *Token) SetAccessExpiresIn(exp time.Duration)

SetAccessExpiresIn the lifetime in seconds of the access token

func (*Token) SetClientID

func (t *Token) SetClientID(clientID string)

SetClientID the client id

func (*Token) SetCode

func (t *Token) SetCode(code string)

SetCode authorization code

func (*Token) SetCodeChallenge

func (t *Token) SetCodeChallenge(code string)

SetCodeChallenge challenge code

func (*Token) SetCodeChallengeMethod

func (t *Token) SetCodeChallengeMethod(method oauth2.CodeChallengeMethod)

SetCodeChallengeMethod challenge method

func (*Token) SetCodeCreateAt

func (t *Token) SetCodeCreateAt(createAt time.Time)

SetCodeCreateAt create Time

func (*Token) SetCodeExpiresIn

func (t *Token) SetCodeExpiresIn(exp time.Duration)

SetCodeExpiresIn the lifetime in seconds of the authorization code

func (*Token) SetRedirectURI

func (t *Token) SetRedirectURI(redirectURI string)

SetRedirectURI redirect URI

func (*Token) SetRefresh

func (t *Token) SetRefresh(refresh string)

SetRefresh refresh Token

func (*Token) SetRefreshCreateAt

func (t *Token) SetRefreshCreateAt(createAt time.Time)

SetRefreshCreateAt create Time

func (*Token) SetRefreshExpiresIn

func (t *Token) SetRefreshExpiresIn(exp time.Duration)

SetRefreshExpiresIn the lifetime in seconds of the refresh token

func (*Token) SetScope

func (t *Token) SetScope(scope string)

SetScope get scope of authorization

func (*Token) SetUserID

func (t *Token) SetUserID(userID string)

SetUserID the user id

Jump to

Keyboard shortcuts

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