Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID uint `gorm:"primary_key" json:"id"` Name string `json:"name"` Password string `json:"-"` AuthorityID uint `json:"authority_id"` Authority *Authority `json:"authority"` }
Account defines struct of account data.
func NewAccount ¶
NewAccount is constructor.
func NewAccountWithPlainPassword ¶
NewAccountWithPlainPassword is constructor. And it is encoded plain text password by using bcrypt.
func (*Account) Create ¶
func (a *Account) Create(rep *repository.Repository) (*Account, error)
Create persists this account data.
func (*Account) FindByName ¶
func (a *Account) FindByName(rep *repository.Repository, name string) (*Account, error)
FindByName returns accounts full matched given account name.
type Authority ¶
Authority defines struct of authority data.
func (*Authority) Create ¶
func (a *Authority) Create(rep *repository.Repository) (*Authority, error)
Create persists this authority data.
Click to show internal directories.
Click to hide internal directories.