stores

package
v0.0.0-...-730ab85 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientPrefix = "/sapi/oauth2/client"
View Source
var TokenPrefix = "/sapi/oauth2/token"

Functions

This section is empty.

Types

type Client

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

type ClientStore

type ClientStore struct {
	Store  store.Store
	Prefix string
	Expire time.Duration
}

func (*ClientStore) GetClient

func (cs *ClientStore) GetClient(ctx context.Context, id string) (*Client, error)

func (*ClientStore) Set

func (cs *ClientStore) Set(ctx context.Context, id string, cli *Client) error

type TokenStore

type TokenStore struct {
	Store store.Store

	Prefix string
}

func (*TokenStore) Create

func (ts *TokenStore) Create(ctx context.Context, token *token.Token) error

func (*TokenStore) GetByAccess

func (ts *TokenStore) GetByAccess(ctx context.Context, access string) (*token.Token, error)

func (*TokenStore) GetByRefresh

func (ts *TokenStore) GetByRefresh(ctx context.Context, refresh string) (*token.Token, error)

func (*TokenStore) GetTokenByCode

func (ts *TokenStore) GetTokenByCode(ctx context.Context, code string) (*token.Token, error)

func (*TokenStore) RemoveByAccess

func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) error

func (*TokenStore) RemoveByCode

func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) error

func (*TokenStore) RemoveByRefresh

func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error

Jump to

Keyboard shortcuts

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