oauth2ent

package module
v0.0.0-...-c29ae76 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 11 Imported by: 0

README

go-oauth2-ent

A go-oauth2 storage based on go-oauth2-mysql but using ent orm.

Documentation

Index

Constants

View Source
const (
	DefaultInterval = 600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStoreWithClient

func NewStoreWithClient(ctx context.Context, client *ent.Client, gcInterval int, dialect string) (*Store, error)

func NewStoreWithDB

func NewStoreWithDB(ctx context.Context, db *sql.DB, gcInterval int, dialect string) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) Create

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

Create create and store the new token information

func (*Store) GetByAccess

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

GetByAccess use the access token for token information data

func (*Store) GetByCode

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

GetByCode use the authorization code for token information data

func (*Store) GetByRefresh

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

GetByRefresh use the refresh token for token information data

func (*Store) RemoveByAccess

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

RemoveByAccess use the access token to delete the token information

func (*Store) RemoveByCode

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

RemoveByCode delete the authorization code

func (*Store) RemoveByRefresh

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

RemoveByRefresh use the refresh token to delete the token information

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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