Documentation ¶
Index ¶
- Constants
- type Config
- type Plugin
- func (p *Plugin) Init(cfg config.Configurer, s storage.UserStorage, client redis.UniversalClient) error
- func (p *Plugin) Name() string
- func (p *Plugin) SessByRefreshToken(ctx context.Context, refreshToken string) (Session, error)
- func (p *Plugin) SessByUser(ctx context.Context, user models.User, metadata any) (Session, error)
- func (p *Plugin) ValidateJWT(ctx context.Context, token string) (jwt.UserClaims, models.User, error)
- type Service
- type Session
- type Storage
- type StorageData
Constants ¶
View Source
const PluginName = "token"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PrivateKey string `mapstructure:"private_key"` TTL struct { JWT time.Duration `mapstructure:"jwt"` Refresh time.Duration `mapstructure:"refresh"` } `mapstructure:"ttl"` }
func (*Config) InitDefault ¶
func (cfg *Config) InitDefault()
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Init ¶
func (p *Plugin) Init(cfg config.Configurer, s storage.UserStorage, client redis.UniversalClient) error
func (*Plugin) SessByRefreshToken ¶
func (*Plugin) SessByUser ¶
type StorageData ¶
Click to show internal directories.
Click to hide internal directories.