Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CaseInsensitiveAcountProvider = &PlainAccountProvider{ Prefix: "", CaseInsensitive: true, }
CaseInsensitiveAcountProvider plain account provider which case insensitive
var CaseSensitiveAcountProvider = &PlainAccountProvider{ Prefix: "", CaseInsensitive: false, }
CaseSensitiveAcountProvider plain account provider which case sensitive
var ErrAccountBindingExists = errors.New("account binding exists")
ErrAccountBindingExists error rasied when account exists when binding
var ErrAccountUnbindingNotExists = errors.New("account unbinding does not exist")
ErrAccountUnbindingNotExists error rasied when account does not exist when unbinding
var ErrUserExists = errors.New("user exists")
ErrUserExists error raseid when user does exist.
var ErrUserNotExists = errors.New("user does not exist")
ErrUserNotExists error raseid when user does not exist.
Functions ¶
This section is empty.
Types ¶
type AccountProvider ¶
type AccountProvider interface {
//NewAccount create new account with keyword and account
NewAccount(keyword string, account string) (*Account, error)
}
AccountProvider account provider interface
type Accounts ¶
type Accounts []*Account
Accounts type account list
func (*Accounts) Bind ¶
Bind add account to accountlist. Return any error if raised. If account exists in account list,error ErrAccountBindingExists will be raised.
type PlainAccountProvider ¶
PlainAccountProvider plain account provider.
func (*PlainAccountProvider) NewAccount ¶
func (p *PlainAccountProvider) NewAccount(keyword string, account string) (*Account, error)
NewAccount create new account is CaseInsensitive is true,account name will be convert to lower