Documentation ¶
Index ¶
- type TokenServiceImpl
- func (i *TokenServiceImpl) Destory() error
- func (i *TokenServiceImpl) Init() error
- func (i *TokenServiceImpl) IssueToken(ctx context.Context, in *token.IssueTokenRequest) (*token.Token, error)
- func (i *TokenServiceImpl) RevokeToken(ctx context.Context, in *token.RevokeTokenRequest) (*token.Token, error)
- func (i *TokenServiceImpl) ValidateToken(ctx context.Context, in *token.ValidateTokenRequest) (*token.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenServiceImpl ¶
type TokenServiceImpl struct {
// contains filtered or unexported fields
}
怎么实现token.Service接口? 定义TokenServiceImpl来实现接口
func NewTokenServiceImpl ¶
func NewTokenServiceImpl(userServiceImpl user.Service) *TokenServiceImpl
func (*TokenServiceImpl) IssueToken ¶
func (i *TokenServiceImpl) IssueToken( ctx context.Context, in *token.IssueTokenRequest) ( *token.Token, error)
登录: 颁发令牌 依赖User模块来检验 用户的密码是否正确
func (*TokenServiceImpl) RevokeToken ¶
func (i *TokenServiceImpl) RevokeToken( ctx context.Context, in *token.RevokeTokenRequest) ( *token.Token, error)
退出: 撤销令牌 是否需要保证幂等性,
func (*TokenServiceImpl) ValidateToken ¶
func (i *TokenServiceImpl) ValidateToken( ctx context.Context, in *token.ValidateTokenRequest) ( *token.Token, error)
校验令牌
Click to show internal directories.
Click to hide internal directories.