Documentation ¶
Index ¶
- Variables
- func AddEmail(db *sql.DB, user *User, email EmailRecord) error
- func DelEmail(db *sql.DB, user *User, email string) error
- func Feedback(db *sql.DB, user *User, now int64, text string) error
- func ParseSocialKey(socialkey []byte) (service, id string)
- func SetLogin(db *sql.DB, user *User, username, password string) error
- func SetUserPassword(db *sql.DB, user *User) error
- func SetUserPrefs(db *sql.DB, user *User) error
- func SocialKey(service, uid string) string
- type EmailMetadata
- type EmailRecord
- type PrefsBlob
- type User
- type UserDB
- type UserSocial
Constants ¶
This section is empty.
Variables ¶
View Source
var BadUserError = errors.New("bad user name & password")
Functions ¶
func ParseSocialKey ¶
Types ¶
type EmailMetadata ¶
type EmailRecord ¶
type EmailRecord struct { Email string EmailMetadata }
func NewEmail ¶
func NewEmail(email string) EmailRecord
type User ¶
type User struct { // primary key Guid int64 // goog, fb, twit, etc. Social []UserSocial // Local Username must be unique across local users Username string Password []byte // lost password recovery, notifications Email []EmailRecord // What we show them when we talk to them. "Hi, ____" // Need not be unique. DisplayName string // Serialized by encoding/json or similar Data map[string]interface{} }
func (*User) BestDisplayName ¶
func (*User) GoodPassword ¶
func (*User) SetPassword ¶
type UserDB ¶
type UserDB interface { // Setup will create or mirgate tables Setup() error PutNewUser(nu *User) (*User, error) GetUser(guid int64) (*User, error) GetLocalUser(username string) (*User, error) GetSocialUser(service, id string) (*User, error) // copy misc data out of User struct into preferences SetUserPrefs(user *User) error SetUserPassword(user *User) error // Set local login for a social-login user SetLogin(user *User, username, password string) error AddEmail(user *User, email EmailRecord) error DelEmail(user *User, email string) error Feedback(user *User, now int64, text string) error }
Actions on users: new user (with local/social/email) disable user delete user
add local login to user update user local password update user prefs
add/del email to user set metadata for email
add/del social login to user set metadata for social
func NewSqlUserDB ¶
type UserSocial ¶
Click to show internal directories.
Click to hide internal directories.