mysql

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: 12 Imported by: 0

Documentation

Overview

Package mysql holds view model repositories

Package mysql holds view model repositories

Package mysql holds view model repositories

Package mysql holds view model repositories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientRepository

func NewClientRepository(ctx context.Context, cfg *config.Config, db *sql.DB) (persistence.ClientRepository, error)

NewClientRepository returns mysql view model repository for client

func NewTokenRepository

func NewTokenRepository(ctx context.Context, db *sql.DB) (persistence.TokenRepository, error)

NewTokenRepository returns mysql view model repository for token

Types

type Client

type Client struct {
	ID          string   `json:"id"`
	UserID      string   `json:"user_id"`
	Secret      string   `json:"secret"`
	Domain      string   `json:"domain"`
	RedirectURL string   `json:"redirect_url"`
	Scopes      []string `json:"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"`
	ClientID  string           `json:"-"`
	UserID    string           `json:"-"`
	Access    string           `json:"access"`
	Refresh   mysql.NullString `json:"refresh,omitempty"`
	Code      mysql.NullString `json:"-"`
	UserAgent mysql.NullString `json:"user_agent,omitempty"`
	ExpiredAt time.Time        `json:"-"`
	Data      json.RawMessage  `json:"-"`
}

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