mongo

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthCode

func NewAuthCode(mm interfaces.Models, m *Storage, db *mongo.Database) (res interfaces.AuthCode, err error)

func NewTokens

func NewTokens(mm interfaces.Models, m *Storage, db *mongo.Database) (res interfaces.Tokens, err error)

Types

type AuthCode

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

func (*AuthCode) Add

func (c *AuthCode) Add(enableTracing bool, ctx context.Context, req *auth.AuthCodeList) (err error)

func (*AuthCode) Del

func (c *AuthCode) Del(enableTracing bool, ctx context.Context, req *auth.AuthCodeList) (err error)

func (*AuthCode) FindByCode

func (c *AuthCode) FindByCode(enableTracing bool, ctx context.Context, code string) (res []*auth.AuthCodeList, err error)

func (*AuthCode) FindByState

func (c *AuthCode) FindByState(enableTracing bool, ctx context.Context, state string) (res []*auth.AuthCodeList, err error)

type Storage

type Storage struct {
	Options        *interfaces.AuthOption
	DefaultTimeout time.Duration
	// contains filtered or unexported fields
}

func (*Storage) AuthCode

func (c *Storage) AuthCode() interfaces.AuthCode

func (*Storage) CreteIndex

func (c *Storage) CreteIndex(col *mongo.Collection, mongoIndexModel []types.MongoIndex) error

func (*Storage) Id

func (c *Storage) Id() string

func (*Storage) Init

func (c *Storage) Init() (err error)

func (*Storage) Tokens

func (c *Storage) Tokens() interfaces.Tokens

type Tokens

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

func (*Tokens) DeleteToken

func (c *Tokens) DeleteToken(enableTracing bool, ctx context.Context, userid, id string) (err error)

func (*Tokens) Find

func (c *Tokens) Find(enableTracing bool, ctx context.Context, query interface{}) (res []*auth.TokenList, err error)

func (*Tokens) FindByID

func (c *Tokens) FindByID(enableTracing bool, ctx context.Context, param string) (res []*auth.TokenList, err error)

func (*Tokens) GetToken

func (c *Tokens) GetToken(enableTracing bool, ctx context.Context, userid, id, appId string, withApp bool) (res types.TokenData, err error)

func (*Tokens) InsertToken

func (c *Tokens) InsertToken(enableTracing bool, ctx context.Context, req *auth.TokenList) (err error)

func (*Tokens) RevokeToken

func (c *Tokens) RevokeToken(enableTracing bool, ctx context.Context, userid, id string) (err error)

func (*Tokens) TerminateOtherTokens

func (c *Tokens) TerminateOtherTokens(enableTracing bool, ctx context.Context, userid, id string) (err error)

Jump to

Keyboard shortcuts

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