Documentation ¶
Overview ¶
Package kv contains wrapper implementations over generic KV storage.
Index ¶
- Variables
- type Credentials
- func (c Credentials) Password(ctx context.Context) (string, error)
- func (c Credentials) Phone(ctx context.Context) (string, error)
- func (c Credentials) SavePassword(ctx context.Context, password string) error
- func (c Credentials) SavePhone(ctx context.Context, phone string) error
- func (c Credentials) WithPasswordKey(passwordKey string) Credentials
- func (c Credentials) WithPhoneKey(phoneKey string) Credentials
- type Session
- type Storage
Constants ¶
This section is empty.
Variables ¶
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound is a special error to return when given key not found.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials is a generic implementation of credential storage over key-value Storage.
func NewCredentials ¶
func NewCredentials(storage Storage) Credentials
NewCredentials creates new Credentials.
func (Credentials) Password ¶
func (c Credentials) Password(ctx context.Context) (string, error)
Password implements Credentials and returns password.
func (Credentials) Phone ¶
func (c Credentials) Phone(ctx context.Context) (string, error)
Phone implements Credentials and returns phone.
func (Credentials) SavePassword ¶
func (c Credentials) SavePassword(ctx context.Context, password string) error
SavePassword stores given password to storage.
func (Credentials) SavePhone ¶
func (c Credentials) SavePhone(ctx context.Context, phone string) error
SavePhone stores given phone to storage.
func (Credentials) WithPasswordKey ¶
func (c Credentials) WithPasswordKey(passwordKey string) Credentials
WithPasswordKey sets password key to use.
func (Credentials) WithPhoneKey ¶
func (c Credentials) WithPhoneKey(phoneKey string) Credentials
WithPhoneKey sets phone key to use.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a generic implementation of session storage over key-value Storage.
func NewSession ¶
NewSession creates new Session.
func (Session) LoadSession ¶
LoadSession loads session using given key from storage.