Documentation ¶
Index ¶
- Variables
- type DbAuthenicator
- func (db *DbAuthenicator) Account(idOrEmail interface{}) (*auth.Account, error)
- func (db *DbAuthenicator) AccountGroups(listOptions model.ListOptions) (*[]auth.Group, error)
- func (db *DbAuthenicator) Accounts(listOptions model.ListOptions) (*[]auth.Account, error)
- func (db *DbAuthenicator) CreateAccount(groupId uint64, a *auth.Account) error
- func (db *DbAuthenicator) CreateGroup(g *auth.Group) error
- func (db *DbAuthenicator) DeleteAccount(a *auth.Account) error
- func (db *DbAuthenicator) DeleteGroup(groupId uint64) error
- func (db *DbAuthenicator) EncryptPassword(password string) string
- func (db *DbAuthenicator) Group(id uint64) (*auth.Group, error)
- func (db *DbAuthenicator) GroupAccounts(listOptions model.ListOptions) (*[]auth.Account, error)
- func (db *DbAuthenicator) Groups(listOptions model.ListOptions) (*[]auth.Group, error)
- func (db *DbAuthenicator) JoinGroup(accountId, groupId uint64) error
- func (db *DbAuthenicator) LeaveGroup(accountId, groupId uint64) error
- func (db *DbAuthenicator) Login(a *auth.Account) (string, error)
- func (db *DbAuthenicator) ModificationAllowed() bool
- func (db *DbAuthenicator) UpdaetAccount(a *auth.Account) error
- func (db *DbAuthenicator) UpdateGroup(g *auth.Group) error
- type Default
- func (d *Default) Account(idOrEmail interface{}) (*auth.Account, error)
- func (d *Default) AccountGroups(listOptions model.ListOptions) (auths *[]auth.Group, err error)
- func (d *Default) Accounts(listOptions model.ListOptions) (auths *[]auth.Account, err error)
- func (d *Default) CreateAccount(groupId uint64, a *auth.Account) error
- func (d *Default) CreateGroup(g *auth.Group) error
- func (d *Default) DeleteAccount(a *auth.Account) error
- func (d *Default) DeleteGroup(groupId uint64) error
- func (d *Default) EncryptPassword(password string) string
- func (d *Default) GetDefaultAccounts() []auth.Account
- func (d *Default) Group(id uint64) (*auth.Group, error)
- func (d *Default) Groups(listOptions model.ListOptions) (auths *[]auth.Group, err error)
- func (d *Default) JoinGroup(accountId, groupId uint64) error
- func (d *Default) LeaveGroup(accountId, groupId uint64) error
- func (d *Default) Login(a *auth.Account) (string, error)
- func (d *Default) ModificationAllowed() bool
- func (d *Default) UpdateAccount(a *auth.Account) error
- func (d *Default) UpdateGroup(g *auth.Group) error
- type Ldap
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Accounts = []auth.Account{ {ID: 1, Title: "Engineering", Email: "admin@admin.com", Password: "adminadmin"}, } Groups = []auth.Group{ {ID: 1, Name: "developers"}, {ID: 2, Name: "operation"}, } )
Functions ¶
This section is empty.
Types ¶
type DbAuthenicator ¶
type DbAuthenicator struct { DbClient *gorm.DB auth.Authenticator }
func NewDBAuthenticator ¶
func NewDBAuthenticator(dbDriver, dbDsn string) *DbAuthenicator
func (*DbAuthenicator) Account ¶
func (db *DbAuthenicator) Account(idOrEmail interface{}) (*auth.Account, error)
func (*DbAuthenicator) AccountGroups ¶
func (db *DbAuthenicator) AccountGroups(listOptions model.ListOptions) (*[]auth.Group, error)
func (*DbAuthenicator) Accounts ¶
func (db *DbAuthenicator) Accounts(listOptions model.ListOptions) (*[]auth.Account, error)
func (*DbAuthenicator) CreateAccount ¶
func (db *DbAuthenicator) CreateAccount(groupId uint64, a *auth.Account) error
func (*DbAuthenicator) CreateGroup ¶
func (db *DbAuthenicator) CreateGroup(g *auth.Group) error
func (*DbAuthenicator) DeleteAccount ¶
func (db *DbAuthenicator) DeleteAccount(a *auth.Account) error
func (*DbAuthenicator) DeleteGroup ¶
func (db *DbAuthenicator) DeleteGroup(groupId uint64) error
func (*DbAuthenicator) EncryptPassword ¶
func (db *DbAuthenicator) EncryptPassword(password string) string
func (*DbAuthenicator) GroupAccounts ¶
func (db *DbAuthenicator) GroupAccounts(listOptions model.ListOptions) (*[]auth.Account, error)
func (*DbAuthenicator) Groups ¶
func (db *DbAuthenicator) Groups(listOptions model.ListOptions) (*[]auth.Group, error)
func (*DbAuthenicator) JoinGroup ¶
func (db *DbAuthenicator) JoinGroup(accountId, groupId uint64) error
func (*DbAuthenicator) LeaveGroup ¶
func (db *DbAuthenicator) LeaveGroup(accountId, groupId uint64) error
func (*DbAuthenicator) ModificationAllowed ¶
func (db *DbAuthenicator) ModificationAllowed() bool
func (*DbAuthenicator) UpdaetAccount ¶
func (db *DbAuthenicator) UpdaetAccount(a *auth.Account) error
func (*DbAuthenicator) UpdateGroup ¶
func (db *DbAuthenicator) UpdateGroup(g *auth.Group) error
type Default ¶
type Default struct {
auth.Authenticator
}
func NewDefaultAuthenticator ¶
func NewDefaultAuthenticator() *Default
func (*Default) AccountGroups ¶
func (*Default) CreateAccount ¶
func (*Default) DeleteGroup ¶
func (*Default) EncryptPassword ¶
func (*Default) GetDefaultAccounts ¶
func (*Default) LeaveGroup ¶
func (*Default) ModificationAllowed ¶
Click to show internal directories.
Click to hide internal directories.