account

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidName     = errors.New("invalid name")
	ErrInvalidPassword = errors.New("invalid password")
	ErrInvalidEmail    = errors.New("invalid email address")

	GravatarURI = "https://gravatar.com/avatar/%s?s=%v"

	RegexpEmail = regexp.MustCompile(`^[^@]+@[^@.]+\.[^@.]+`)
)

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       *int64     `json:"-" db:"id"`
	UID      *string    `json:"uid" db:"uid"`
	Email    *string    `json:"email" db:"email"`
	Name     *string    `json:"name, omitempty" db:"name"`
	Password *string    `json:"password, omitempty" db:"password"`
	Active   *bool      `json:"active" db:"active"`
	Gravatar *string    `json:"gravatar" db:"gravatar"`
	Created  *time.Time `json:"created" db:"created"`
	Updated  *time.Time `json:"updated" db:"updated"`
	Deleted  *bool      `json:"deleted, omitempty" db:"deleted"`
}

func NewAccount

func NewAccount(email, name, password string) (*Account, error)

func (*Account) Delete

func (account *Account) Delete() error

func (*Account) DeletePassword

func (account *Account) DeletePassword() error

func (*Account) MatchPassword

func (account *Account) MatchPassword(password string) error

func (*Account) SetPassword

func (account *Account) SetPassword(password string) error

func (*Account) UpdatePassword

func (account *Account) UpdatePassword(newPassword string) error

func (*Account) ValidateFields

func (a *Account) ValidateFields() error

Jump to

Keyboard shortcuts

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