Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
RedisClient holds our redis connexion
func NewRedisClient ¶
func NewRedisClient(config *context.Config) *RedisClient
NewRedisClient creates a new redis connexion
func (*RedisClient) GenerateToken ¶
func (client *RedisClient) GenerateToken(userID string) (string, error)
GenerateToken generate a random string
func (*RedisClient) GetUserID ¶
func (client *RedisClient) GetUserID(token string) (string, error)
GetUserID token retrieves the value of the token from our storage
func (*RedisClient) Ping ¶
func (client *RedisClient) Ping() (string, error)
Ping pings redis to see if we are connected
type Strategy ¶
type Strategy interface { GenerateToken(userID string) (string, error) GetUserID(token string) (string, error) }
Strategy holds our strategies
type Tokenizer ¶
type Tokenizer struct {
Strategy Strategy
}
Tokenizer holds the strategy
func (*Tokenizer) GenerateToken ¶
GenerateToken return our GenerateToken strategy
Click to show internal directories.
Click to hide internal directories.