Documentation ¶
Index ¶
- func BytesToString(b []byte) string
- func StringToBytes(s string) []byte
- type Coder
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) Delete(ctx context.Context, access string) (e error)
- func (m *Manager) DeleteID(ctx context.Context, id string) (e error)
- func (m *Manager) DeletePlatform(ctx context.Context, id, platform string) (e error)
- func (m *Manager) Get(ctx context.Context, access string) (token *Token, session interface{}, e error)
- func (m *Manager) GetRaw(ctx context.Context, access string) (key string, token *Token, b []byte, e error)
- func (m *Manager) NewToken(prefix string) (token string, e error)
- func (m *Manager) Put(ctx context.Context, id, platform string, session interface{}) (token *Token, e error)
- func (m *Manager) Refresh(ctx context.Context, access, refresh string) (token *Token, session interface{}, e error)
- func (m *Manager) Sin(playdata string) (token string, e error)
- func (m *Manager) Verify(token string) (playdata string, e error)
- type Option
- type Store
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string.
func StringToBytes ¶
StringToBytes converts string to byte slice.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) DeletePlatform ¶
刪除指定用戶 id 在 指定平臺 platform 的所有 session
func (*Manager) Get ¶
func (m *Manager) Get(ctx context.Context, access string) (token *Token, session interface{}, e error)
返回 token 關聯的 session 數據
func (*Manager) GetRaw ¶
func (m *Manager) GetRaw(ctx context.Context, access string) (key string, token *Token, b []byte, e error)
返回 token 關聯的 後端原始數據
func (*Manager) Put ¶
func (m *Manager) Put(ctx context.Context, id, platform string, session interface{}) (token *Token, e error)
創建 session 關聯的 token
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAccess ¶
func WithDeadline ¶
func WithMethod ¶
func WithMethod(method cryptoer.SigningMethod) Option
func WithRefresh ¶
type Store ¶
type Store interface { // 設置數據 Put(ctx context.Context, key string, value []byte, deadline time.Time) (e error) // 返回數據 Get(ctx context.Context, key string) (value []byte, e error) // 刪除數據 Del(ctx context.Context, key string) (e error) // 刪除指定前綴的數據 DelPrefix(ctx context.Context, prefix string) (e error) // 關閉存儲設備 釋放相關資源 Close() (e error) }
Click to show internal directories.
Click to hide internal directories.