Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RenewLocker ¶
type RenewLocker interface { Acquire(key string, ttl time.Duration) (bool, error) Release(key string) error }
RenewLocker TOKEN刷新锁 在刷新TOKEN之前申请许可, 通过后方可刷新TOKEN
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
func New ¶
func New(apiKey, secretKey string, storage TokenStorage) *SDK
type TokenStorage ¶
type TokenStorage interface { Store(key, value string, ttl time.Duration) error Fetch(key string) (string, error) }
TokenStorage TOKEN持久化
func RedisStorage ¶
func RedisStorage(client *redigo.Client) TokenStorage
Click to show internal directories.
Click to hide internal directories.