mongo

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientRepository

func NewClientRepository(ctx context.Context, cfg *config.Config, mongoDB *mongo.Database) (persistence.ClientRepository, error)

NewClientRepository returns mongo view model repository for client

func NewTokenRepository

func NewTokenRepository(ctx context.Context, mongoDB *mongo.Database) (persistence.TokenRepository, error)

NewTokenRepository returns mongo view model repository for token

Types

type Client

type Client struct {
	ID          string   `json:"id" bson:"client_id"`
	UserID      string   `json:"user_id" bson:"user_id"`
	Secret      string   `json:"secret" bson:"secret"`
	Domain      string   `json:"domain" bson:"domain"`
	RedirectURL string   `json:"redirect_url" bson:"redirect_url"`
	Scopes      []string `json:"scopes" bson:"scopes"`
}

Client model

func (*Client) ClientInfo

func (c *Client) ClientInfo() (oauth2.ClientInfo, error)

func (*Client) GetDomain

func (c *Client) GetDomain() string

func (*Client) GetID

func (c *Client) GetID() string

func (*Client) GetRedirectURL

func (c *Client) GetRedirectURL() string

func (*Client) GetScopes

func (c *Client) GetScopes() []string

func (*Client) GetSecret

func (c *Client) GetSecret() string

func (*Client) GetUserID

func (c *Client) GetUserID() string

type Token

type Token struct {
	ID        string          `json:"id" bson:"token_id"`
	ClientID  string          `json:"-" bson:"client_id"`
	UserID    string          `json:"-" bson:"user_id"`
	Access    string          `json:"access" bson:"access"`
	Refresh   string          `json:"refresh,omitempty" bson:"refresh,omitempty"`
	Code      string          `json:"-" bson:"code"`
	UserAgent string          `json:"user_agent,omitempty" bson:"user_agent,omitempty"`
	ExpiredAt *time.Time      `json:"-" bson:"expiredAt"`
	Data      json.RawMessage `json:"-" bson:"data"`
}

Token model

func (*Token) GetData

func (t *Token) GetData() json.RawMessage

func (*Token) GetID

func (t *Token) GetID() string

func (*Token) GetUserAgent

func (t *Token) GetUserAgent() string

func (*Token) TokenInfo

func (t *Token) TokenInfo() (oauth2.TokenInfo, error)

Jump to

Keyboard shortcuts

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