Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClaims ¶
type AuthClaims struct { Username string `json:"user_name"` Locked bool `json:"locked"` Role string `json:"role"` }
AuthClaims is a custom claims object that contains user authentication and authorization infomration.
type AuthSvc ¶
type AuthSvc interface { CreateToken(user *cmdb.User) (token *Token, err error) CreateTokenString(token *Token) (tokenString string, err error) ParseTokenString(tokenString string) (token *Token, err error) CreateCookie(tokenString string) (cookie *http.Cookie, err error) ReadCookie(request *http.Request) (tokenString string, err error) }
AuthSvc is an interface that creates, parses, and validates Tokens.
func NewAuthSvc ¶
NewAuthSvc returns an object that implements the AuthSvc interface.
type Claims ¶
type Claims struct { jwt.StandardClaims AuthClaims }
Claims is a custom Claims object that extends jwt.StandardClaims.
type LoggerSvc ¶
type LoggerSvc interface { SystemLog() log.MLogger AccessLog() log.MLogger ErrorLog() log.MLogger Close() }
LoggerSvc is a collection of LoggerSvc with a getter method.
type MetaUsbSvc ¶
type MetaUsbSvc interface { VendorName(vid string) (string, error) ProductName(vid, pid string) (string, error) ClassDesc(cid string) (string, error) SubClassDesc(cid, sid string) (string, error) ProtocolDesc(cid, sid, pid string) (string, error) LastUpdate() time.Time Raw() *peripheral.Usb Refresh() error Save() error }
MetaUsbSvc is an interface that creates serial numbers from seed values.
func NewMetaUsbSvc ¶
func NewMetaUsbSvc(cf string) (MetaUsbSvc, error)
NewMetaUsbSvc returns an object that implements the MetaUsbSvc interface.
type SerialSvc ¶
SerialSvc is an interface that creates serial numbers from seed values.
func NewSerialSvc ¶
NewSerialSvc returns an object that implements the SerialSvc interface.
type Token ¶
Token is a custom Token object that extends jwt.Token.
func (*Token) AuthClaims ¶
func (this *Token) AuthClaims() AuthClaims
AuthClaims extracts the AuthClaim claim from the token.