Documentation ¶
Index ¶
- type Configuration
- type Repository
- func (r *Repository) ChangeToken(ctx context.Context, guid, oldAccessToken, refreshToken, accessToken string) error
- func (r *Repository) Close(ctx context.Context) error
- func (r *Repository) GetToken(ctx context.Context, guid, accessToken string) (*token.Token, error)
- func (r *Repository) RemoveAllTokens(ctx context.Context, guid string) error
- func (r *Repository) RemoveToken(ctx context.Context, guid, accessToken string) error
- func (r *Repository) SaveToken(ctx context.Context, tkn *token.Token) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
Configuration is settings for mongodb connection
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository with users' credentials
func New ¶
func New(ctx context.Context, conf *Configuration) (*Repository, error)
New returns new instance of repository
func (*Repository) ChangeToken ¶
func (r *Repository) ChangeToken(ctx context.Context, guid, oldAccessToken, refreshToken, accessToken string) error
ChangeToken changes token by ids guid
func (*Repository) Close ¶
func (r *Repository) Close(ctx context.Context) error
Close connetction to database
func (*Repository) RemoveAllTokens ¶
func (r *Repository) RemoveAllTokens(ctx context.Context, guid string) error
RemoveAllTokens remove all user's tokens by guid
func (*Repository) RemoveToken ¶
func (r *Repository) RemoveToken(ctx context.Context, guid, accessToken string) error
RemoveToken removes user's token by guid and access token
Click to show internal directories.
Click to hide internal directories.