sqlite

package module
v0.0.0-...-808ba11 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 9 Imported by: 0

README

Sqlite3 Storage for go-oauth2/oauth2

Based on go-oauth2/mysql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientItem

type ClientItem struct {
	Id     string
	Secret string
	Domain string
	UserId string
}

type ClientRepository

type ClientRepository struct {
	// contains filtered or unexported fields
}

func NewClientRepository

func NewClientRepository(filename string) (*ClientRepository, error)

func (*ClientRepository) Close

func (repo *ClientRepository) Close()

func (*ClientRepository) GetById

func (repo *ClientRepository) GetById(id string) (*ClientItem, error)

func (*ClientRepository) Insert

func (repo *ClientRepository) Insert(item *ClientItem) error

func (*ClientRepository) RemoveById

func (repo *ClientRepository) RemoveById(id string) error

type ClientStore

type ClientStore struct {
	// contains filtered or unexported fields
}

func NewClientStore

func NewClientStore(filename string) (*ClientStore, error)

func (*ClientStore) GetByID

func (c *ClientStore) GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error)

func (*ClientStore) RemoveByID

func (c *ClientStore) RemoveByID(ctx context.Context, id string) error

func (*ClientStore) Set

func (c *ClientStore) Set(ctx context.Context, info oauth2.ClientInfo) error

type TokenInfo

type TokenInfo = oauth2.TokenInfo

type TokenItem

type TokenItem struct {
	Id        int64
	ExpiredAt int64
	Code      string
	Access    string
	Refresh   string
	Data      string
}

type TokenRepository

type TokenRepository struct {
	// contains filtered or unexported fields
}

func NewTokenRepository

func NewTokenRepository(filename string) (*TokenRepository, error)

func (*TokenRepository) Close

func (repo *TokenRepository) Close()

func (*TokenRepository) GetTokenByAccess

func (repo *TokenRepository) GetTokenByAccess(access string) (oauth2.TokenInfo, error)

func (*TokenRepository) GetTokenByCode

func (repo *TokenRepository) GetTokenByCode(code string) (oauth2.TokenInfo, error)

func (*TokenRepository) GetTokenByRefresh

func (repo *TokenRepository) GetTokenByRefresh(refresh string) (oauth2.TokenInfo, error)

func (*TokenRepository) Insert

func (repo *TokenRepository) Insert(item *TokenItem) error

func (*TokenRepository) RemoveAccess

func (repo *TokenRepository) RemoveAccess(access string) error

func (*TokenRepository) RemoveCode

func (repo *TokenRepository) RemoveCode(code string) error

func (*TokenRepository) RemoveRefresh

func (repo *TokenRepository) RemoveRefresh(refresh string) error

type TokenStore

type TokenStore struct {
	// contains filtered or unexported fields
}

func NewSqliteStore

func NewSqliteStore(filename string) (*TokenStore, error)

func (*TokenStore) Close

func (s *TokenStore) Close()

func (*TokenStore) Create

func (s *TokenStore) Create(ctx context.Context, info TokenInfo) error

func (*TokenStore) GetByAccess

func (s *TokenStore) GetByAccess(ctx context.Context, access string) (TokenInfo, error)

use the access token for token information data

func (*TokenStore) GetByCode

func (s *TokenStore) GetByCode(ctx context.Context, code string) (TokenInfo, error)

use the authorization code for token information data

func (*TokenStore) GetByRefresh

func (s *TokenStore) GetByRefresh(ctx context.Context, refresh string) (TokenInfo, error)

func (*TokenStore) RemoveByAccess

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

use the access token to delete the token information

func (*TokenStore) RemoveByCode

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

func (*TokenStore) RemoveByRefresh

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

use the refresh token to delete the token information

Jump to

Keyboard shortcuts

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