Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func Setup(conf *config.Config) error
 - type TokenManager
 - func (tm *TokenManager) Delete(pool, namespace, token string) error
 - func (tm *TokenManager) Exist(pool, namespace, token string) (exist bool, err error)
 - func (tm *TokenManager) List(pool, namespace string) (tokens map[string]string, err error)
 - func (tm *TokenManager) New(pool, namespace, token, description string) (string, error)
 
Constants ¶
      View Source
      
  
const TokenPrefix = "tk"
    Variables ¶
      View Source
      
  
    var ErrPoolNotExist error = errors.New("the pool was not exists")
    
      View Source
      
  var ErrTokenExist error = errors.New("the token has already existed")
    ErrTokenExist means the user-defined has already existed
Functions ¶
Types ¶
type TokenManager ¶
type TokenManager struct {
	// contains filtered or unexported fields
}
    func GetTokenManager ¶
func GetTokenManager() *TokenManager
func NewTokenManager ¶
func NewTokenManager(cli *redis.Client) *TokenManager
func (*TokenManager) Delete ¶
func (tm *TokenManager) Delete(pool, namespace, token string) error
func (*TokenManager) Exist ¶
func (tm *TokenManager) Exist(pool, namespace, token string) (exist bool, err error)
 Click to show internal directories. 
   Click to hide internal directories.