Documentation ¶
Index ¶
- type SessionService
- func (s SessionService) AutoMigrate(ctx context.Context) error
- func (s SessionService) Counter(ctx context.Context, seed string, expireTime *time.Time, num ...int64) (err error)
- func (s SessionService) CreateToken(ctx context.Context, token *models.Token) error
- func (s SessionService) DeleteToken(ctx context.Context, tokenType models.TokenType, id string) (err error)
- func (s SessionService) GetCounter(ctx context.Context, seed string) (count int64, err error)
- func (s SessionService) GetSessions(ctx context.Context, userId string, current int64, pageSize int64) (int64, []*models.Token, error)
- func (s SessionService) GetToken(ctx context.Context, tokenId string, tokenType models.TokenType, ...) (*models.Token, error)
- func (s SessionService) Name() string
- func (s SessionService) RefreshOAuthTokenByAuthorizationCode(ctx context.Context, token, clientId, clientSecret string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s SessionService) RefreshOAuthTokenByPassword(ctx context.Context, token, username, password string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s SessionService) UpdateToken(ctx context.Context, token *models.Token) error
- func (s SessionService) UpdateTokenExpires(ctx context.Context, id string, expiry time.Time) error
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionService ¶
func NewSessionService ¶
func NewSessionService(name string, client *redis.Client) *SessionService
func (SessionService) AutoMigrate ¶
func (s SessionService) AutoMigrate(ctx context.Context) error
func (SessionService) CreateToken ¶
func (SessionService) DeleteToken ¶
func (SessionService) GetCounter ¶
func (SessionService) GetSessions ¶
func (SessionService) Name ¶
func (s SessionService) Name() string
func (SessionService) RefreshOAuthTokenByAuthorizationCode ¶
func (SessionService) RefreshOAuthTokenByPassword ¶
func (SessionService) UpdateToken ¶
func (SessionService) UpdateTokenExpires ¶
type Token ¶
type Token struct { Id string `json:"id"` CreateTime time.Time `json:"createTime"` Data string `json:"data,omitempty"` RelationId string `json:"relationId"` Expiry time.Time `json:"expiry"` Type models.TokenType `json:"type"` LastSeen time.Time `json:"lastSeen"` ParentId string `json:"parentId,omitempty"` Childrens []*Token `json:"-"` ChildrensId []string `json:"childrensId,omitempty"` }
func (*Token) MarshalBinary ¶
func (*Token) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.