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 (*Client) GetRedirectURL ¶
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) GetUserAgent ¶
Click to show internal directories.
Click to hide internal directories.