Documentation
¶
Overview ¶
Package sesame is a email/password storage system using RethinkDB and scrypt.
TODO: better docs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { Id interface{} `gorethink:"id"` Email string `gorethink:"email"` Password Password `gorethink:"password"` Salt Salt `gorethink:"salt"` Created time.Time `gorethink:"created"` Updated time.Time `gorethink:"updated"` }
A User combines Password and Salt into an interface to validate plaintext against.
func NewUser ¶
NewPassword creates a new User struct and hashes the password. Created and Updated fields will be set to the time of creation.
func (*User) ChangePassword ¶
ChangePassword is a convenience method to set a new password on a User if and only if the original is valid.
func (*User) SetPassword ¶
SetPassword sets a new hashed password from plaintext
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore manages connections for persisting Users to RethinkDB
func NewUserStore ¶
NewUserStore creates a new `UserStore` from the environment
type UserStoreConfig ¶
UserStoreConfig stores configuration from envconfig.
- `URL`: something like rethinkdb://authkey@host:port/dbname
- `PoolSize`: the maximum number of connections to hold, idles at half of this value.