Documentation ¶
Index ¶
- func CheckSession(sessionKey string) (sessionValue string, err error)
- func Login(email, password, ip string) (sessionKey string, err error)
- func Migrate() error
- func ParseSessionValue(sessionValue string) (id int, isAdmin bool)
- func UpdatePassword(u User, userID int, rawPassword string) error
- type Admin
- type Creater
- type Deleter
- type Getter
- type InvitationReference
- type LoginRecord
- type Member
- func (m *Member) BeforeCreate(tx *gorm.DB) error
- func (m *Member) Create() (interface{}, error)
- func (m *Member) Delete(id int) error
- func (m *Member) Get(id int) error
- func (m *Member) RecordLogin(ip string) error
- func (*Member) Search(values url.Values) (interface{}, error)
- func (m *Member) String() string
- type MemberSource
- type Password
- type Searcher
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSession ¶
func ParseSessionValue ¶
ParseSessionValue finds the user's ID and whether they are an admin. See .String() methods for types that implement the User interface for more information.
Types ¶
type Admin ¶
type Admin struct { ID int `gorm:"primaryKey;autoIncrement" json:"id"` Email string `gorm:"size:255;unique;not null" json:"email" validate:"email"` Name string `gorm:"size:255" json:"name"` PasswordID *int `gorm:"unique" json:"-"` CreatedAt time.Time `gorm:"type:timestamp;not null" json:"createdAt"` UpdatedAt time.Time `gorm:"type:timestamp;not null" json:"updatedAt"` Password *Password `json:"-"` }
func (*Admin) RecordLogin ¶
type InvitationReference ¶
type LoginRecord ¶
type Member ¶
type Member struct { ID int `gorm:"primaryKey;autoIncrement" json:"id"` Email string `gorm:"size:255;unique;not null" json:"email" validate:"email"` Name string `gorm:"size:255" json:"name"` PasswordID *int `gorm:"unique" json:"-"` Phone string `gorm:"size:64" json:"phone" validate:"omitempty,e164"` Approved bool `gorm:"type:boolean not null default false" json:"approved"` Source MemberSource `gorm:"size:16" json:"source" validate:"required"` CreatedAt time.Time `gorm:"type:timestamp;not null" json:"createdAt"` UpdatedAt time.Time `gorm:"type:timestamp;not null" json:"updatedAt"` Password *Password `json:"-"` }
func (*Member) RecordLogin ¶
type MemberSource ¶
type MemberSource string
const ( MemberSourceGuestBook MemberSource = "guestbook" MemberSourceInPerson MemberSource = "in person" MemberSourcePastBooking MemberSource = "past booking" )
Click to show internal directories.
Click to hide internal directories.