Versions in this module Expand all Collapse all v1 v1.0.0 Jan 9, 2019 Changes in this version + var ErrInvalidEmail = errors.New("invalid user email") + var ErrShutdown = errors.New("database is shutting down") + var ErrUserExists = errors.New("user already exists") + var ErrUserNotFound = errors.New("user not found") + func ActiveIdentity(i []Identity) ([identity.PublicKeySize]byte, bool) + func ActiveIdentityString(i []Identity) (string, bool) + func IsIdentityActive(id Identity) bool + type Database interface + AllUsers func(callbackFn func(u *User)) error + Close func() error + UserGet func(string) (*User, error) + UserGetById func(uuid.UUID) (*User, error) + UserGetByUsername func(string) (*User, error) + UserNew func(User) error + UserUpdate func(User) error + type Identity struct + Activated int64 + Deactivated int64 + Key [identity.PublicKeySize]byte + type ProposalCredit struct + CensorshipToken string + DatePurchased int64 + PaywallID uint64 + Price uint64 + TxID string + type ProposalPaywall struct + Address string + CreditPrice uint64 + ID uint64 + NumCredits uint64 + PollExpiry int64 + TxAmount uint64 + TxID string + TxNotBefore int64 + type User struct + Admin bool + Deactivated bool + Email string + EmailNotifications uint64 + FailedLoginAttempts uint64 + HashedPassword []byte + ID uuid.UUID + Identities []Identity + LastLoginTime int64 + NewUserPaywallAddress string + NewUserPaywallAmount uint64 + NewUserPaywallPollExpiry int64 + NewUserPaywallTx string + NewUserPaywallTxNotBefore int64 + NewUserVerificationExpiry int64 + NewUserVerificationToken []byte + PaywallAddressIndex uint64 + ProposalCommentsAccessTimes map[string]int64 + ProposalPaywalls []ProposalPaywall + ResendNewUserVerificationExpiry int64 + ResetPasswordVerificationExpiry int64 + ResetPasswordVerificationToken []byte + SpentProposalCredits []ProposalCredit + UnspentProposalCredits []ProposalCredit + UpdateKeyVerificationExpiry int64 + UpdateKeyVerificationToken []byte + Username string