Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID int64 `xorm:"pk autoincr"` //`json:"id" gorm:"primaryKey; autoIncrement:true"` Name string `xorm:"varchar(16) not null unique 'client_name' comment('NickName')"` //`json:"name" gorm:"not null; unique"` PWD string `xorm:"varchar(32) not null 'client_pwd'"` //`json:"-" gorm:"password"` Status Status `xorm:"smallint not null 'client_status'"` //`json:"status" gorm:"status"` CreatedAt time.Time `xorm:"created"` //`json:"created_at" gorm:"created_at"` UpdatedAt time.Time `xorm:"updated"` //`json:"updated_at" gorm:"updated_at"` Creds []string //`json:"-" gorm:"credentials"` // contains filtered or unexported fields }
A Client represents some client in the system
func (*Client) ClientStatus ¶
ClientStatus returns the client status
func (*Client) MatchPassword ¶
MatchPassword returns true if, and only if, the provided hash do match with the pqssword's one
func (*Client) SetExtension ¶
SetExtension sets an extension to the client
type Controller ¶
type Controller interface { ClientStatus() Status MatchPassword(string) bool GetAddr() string GetID() int64 SetExtension(Extension) bool }
A Controller represents a registered client
func New ¶
func New(name, pwd string) Controller
New builds a brand new client with a provided password
Click to show internal directories.
Click to hide internal directories.