Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKey ¶
type APIKey struct { ID string `json:"id"` Name string `json:"name"` UserID string `json:"userId"` SecretKey string `json:"secretKey"` AccessKey string `json:"accessKey"` Expiration *time.Time `json:"expiration,omitempty"` }
func (*APIKey) DecryptAPIToken ¶
func (apiKey *APIKey) DecryptAPIToken(token string) (payload *APITokenPayload, err error)
通过 Payload 生成 Token
func (*APIKey) GenerateAPIToken ¶
func (apiKey *APIKey) GenerateAPIToken(payload APITokenPayload) (token string, err error)
解密 Token 并返回 Payload
type APITokenPayload ¶
Click to show internal directories.
Click to hide internal directories.