Documentation ¶
Index ¶
- Variables
- type Account
- type AuthMethod
- type AuthMethodType
- type DBStore
- 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
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthMethodTypes = map[AuthMethodType]bool{ AuthMethodTypeAddress: true, AuthMethodTypePhoneNumber: true, AuthMethodTypeEmail: true, }
View Source
var ErrAlreadyExists = errors.New("account already exists")
View Source
var ErrNotFound = errors.New("account not found")
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod struct { Type AuthMethodType Value string }
type AuthMethodType ¶
type AuthMethodType string
const ( AuthMethodTypeAddress AuthMethodType = "hcnet_address" AuthMethodTypePhoneNumber AuthMethodType = "phone_number" AuthMethodTypeEmail AuthMethodType = "email" )
func (AuthMethodType) Valid ¶
func (t AuthMethodType) Valid() bool
type DBStore ¶
func (*DBStore) FindWithIdentityAddress ¶
func (*DBStore) FindWithIdentityAuthMethod ¶
func (s *DBStore) FindWithIdentityAuthMethod(t AuthMethodType, value string) ([]Account, error)
func (*DBStore) FindWithIdentityEmail ¶
func (*DBStore) FindWithIdentityPhoneNumber ¶
type Identity ¶
type Identity struct { Role string AuthMethods []AuthMethod }
type Store ¶
type Store interface { Add(a Account) error Delete(address string) error Get(address string) (Account, error) Update(a Account) error FindWithIdentityAddress(address string) ([]Account, error) FindWithIdentityPhoneNumber(phoneNumber string) ([]Account, error) FindWithIdentityEmail(email string) ([]Account, error) Count() (int, error) }
Click to show internal directories.
Click to hide internal directories.