Versions in this module Expand all Collapse all v0 v0.0.1 Nov 25, 2022 Changes in this version + var AuthMethodTypes = map[AuthMethodType]bool + var ErrAlreadyExists = errors.New("account already exists") + var ErrNotFound = errors.New("account not found") + type Account struct + Address string + Identities []Identity + type AuthMethod struct + Type AuthMethodType + Value string + type AuthMethodType string + const AuthMethodTypeAddress + const AuthMethodTypeEmail + const AuthMethodTypePhoneNumber + func (t AuthMethodType) Valid() bool + type DBStore struct + DB *sqlx.DB + func (s *DBStore) Add(a Account) error + func (s *DBStore) Count() (int, error) + func (s *DBStore) Delete(address string) error + func (s *DBStore) FindWithIdentityAddress(address string) ([]Account, error) + func (s *DBStore) FindWithIdentityAuthMethod(t AuthMethodType, value string) ([]Account, error) + func (s *DBStore) FindWithIdentityEmail(email string) ([]Account, error) + func (s *DBStore) FindWithIdentityPhoneNumber(phoneNumber string) ([]Account, error) + func (s *DBStore) Get(address string) (Account, error) + func (s *DBStore) Update(a Account) error + type Identity struct + AuthMethods []AuthMethod + Role string + type Store interface + Add func(a Account) error + Count func() (int, error) + Delete func(address string) error + FindWithIdentityAddress func(address string) ([]Account, error) + FindWithIdentityEmail func(email string) ([]Account, error) + FindWithIdentityPhoneNumber func(phoneNumber string) ([]Account, error) + Get func(address string) (Account, error) + Update func(a Account) error