helpers

package
v0.0.0-...-bc1fc02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: ISC, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExternalBranch is a helper value that needs to
	// match eacrwallet's udb.ExternalBranch
	ExternalBranch uint32 = 0
)

Variables

This section is empty.

Functions

func DCRUtilAddressFromExtendedKey

func DCRUtilAddressFromExtendedKey(key *hdkeychain.ExtendedKey, params *chaincfg.Params) (*dcrutil.AddressPubKeyHash, error)

DCRUtilAddressFromExtendedKey parses the public address of a hd extended key using a secp256k1 elliptic curve into a ECDSA public key, compresses it using ripemd160, and wraps it in a dcrutil AddressPubKeyHash in order to easily obtain its human readable formats. Returns an error upon a parsing error or if key is for the wrong network.

func EmailChangeComplete

func EmailChangeComplete(dbMap *gorp.DbMap, token models.UserToken) error

func EmailChangeTokenExists

func EmailChangeTokenExists(dbMap *gorp.DbMap, token models.UserToken) (*models.EmailChange, error)

func EmailExists

func EmailExists(dbMap *gorp.DbMap, email string) (*models.User, error)

func EmailVerificationComplete

func EmailVerificationComplete(dbMap *gorp.DbMap, token models.UserToken) error

func EmailVerificationTokenExists

func EmailVerificationTokenExists(dbMap *gorp.DbMap, token models.UserToken) (*models.User, error)

func Login

func Login(dbMap *gorp.DbMap, email string, password string) (*models.User, error)

Login looks up a user by email and validates the provided clear text password against the bcrypt hashed password stored in the DB. Returns the *User and an error. On failure *User is nil and error is non-nil. On success, error is nil.

func Parse

func Parse(t *template.Template, name string, data interface{}) (string, error)

func PasswordResetTokenDelete

func PasswordResetTokenDelete(dbMap *gorp.DbMap, token models.UserToken) error

func PasswordResetTokenExists

func PasswordResetTokenExists(dbMap *gorp.DbMap, token models.UserToken) (*models.PasswordReset, error)

func PasswordValidById

func PasswordValidById(dbMap *gorp.DbMap, id int64, password string) (*models.User, error)

func UpdateUserPasswordById

func UpdateUserPasswordById(dbMap *gorp.DbMap, id int64, password []byte) (*models.User, error)

func UpdateVoteBitsByID

func UpdateVoteBitsByID(dbMap *gorp.DbMap, id int64, voteBits uint16) (*models.User, error)

func UpdateVoteBitsVersionByID

func UpdateVoteBitsVersionByID(dbMap *gorp.DbMap, id int64, voteVersion uint32) (*models.User, error)

func UserIDExists

func UserIDExists(dbMap *gorp.DbMap, userid int64) (*models.User, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL