Versions in this module Expand all Collapse all v0 v0.1.0 Jul 4, 2020 Changes in this version + type Client struct + func NewClient(options ...ConfigOption) *Client + func TestClient(db *sql.DB) *Client + func (c *Client) Device() auth.DeviceRepository + func (c *Client) LoginHistory() auth.LoginHistoryRepository + func (c *Client) NewWithTransaction(ctx context.Context) (auth.RepositoryManager, error) + func (c *Client) User() auth.UserRepository + func (c *Client) WithAtomic(operation func() (interface{}, error)) (interface{}, error) + type ConfigOption func(*Client) + func WithDB(db *sql.DB) ConfigOption + func WithEntropy(entropy io.Reader) ConfigOption + func WithLogger(l log.Logger) ConfigOption + func WithPassword(p auth.PasswordService) ConfigOption + type DeviceRepository struct + func (r *DeviceRepository) ByClientID(ctx context.Context, userID string, clientID []byte) (*auth.Device, error) + func (r *DeviceRepository) ByID(ctx context.Context, deviceID string) (*auth.Device, error) + func (r *DeviceRepository) ByUserID(ctx context.Context, userID string) ([]*auth.Device, error) + func (r *DeviceRepository) Create(ctx context.Context, device *auth.Device) error + func (r *DeviceRepository) GetForUpdate(ctx context.Context, deviceID string) (*auth.Device, error) + func (r *DeviceRepository) Remove(ctx context.Context, deviceID, userID string) error + func (r *DeviceRepository) Update(ctx context.Context, device *auth.Device) error + type LoginHistoryRepository struct + func (r *LoginHistoryRepository) ByUserID(ctx context.Context, userID string, limit, offset int) ([]*auth.LoginHistory, error) + func (r *LoginHistoryRepository) Create(ctx context.Context, login *auth.LoginHistory) error + func (r *LoginHistoryRepository) GetForUpdate(ctx context.Context, tokenID string) (*auth.LoginHistory, error) + func (r *LoginHistoryRepository) Update(ctx context.Context, login *auth.LoginHistory) error + type UserRepository struct + func (r *UserRepository) ByIdentity(ctx context.Context, attribute, value string) (*auth.User, error) + func (r *UserRepository) Create(ctx context.Context, user *auth.User) error + func (r *UserRepository) DisableOTP(ctx context.Context, userID string, method auth.DeliveryMethod) (*auth.User, error) + func (r *UserRepository) GetForUpdate(ctx context.Context, userID string) (*auth.User, error) + func (r *UserRepository) ReCreate(ctx context.Context, user *auth.User) error + func (r *UserRepository) RemoveDeliveryMethod(ctx context.Context, userID string, method auth.DeliveryMethod) (*auth.User, error) + func (r *UserRepository) Update(ctx context.Context, user *auth.User) error v0.1.0-beta.0 Jun 25, 2020