Documentation ¶
Index ¶
- type Service
- func (s *Service) AddTokenInBlackList(tokenRaw string, expires int64)
- func (s *Service) CreateToken(userID string) (*TokenDetails, error)
- func (s *Service) ExtractToken(bearToken string) string
- func (s *Service) ExtractTokenMetadata(token *jwt.Token) (*TokenClaims, error)
- func (s *Service) GetTokenHash(tokenRaw string) [32]byte
- func (s *Service) GroupAddUser(ctx context.Context, userID, systemID, addUserID, addSystemID, reqID string, ...) error
- func (s *Service) GroupCreate(ctx context.Context, req proc.RequestInterface, ...) (*model.UserGroup, error)
- func (s *Service) GroupGetByID(ctx context.Context, userID, systemID string, groupID *uuid.UUID, ...) (*model.UserGroup, error)
- func (s *Service) GroupGetList(ctx context.Context, userID, systemID string) ([]*model.UserGroup, error)
- func (s *Service) GroupRemoveUser(ctx context.Context, ...) error
- func (s *Service) Info(ctx context.Context, userID, systemID string) (*model.UserInfo, error)
- func (s *Service) InfoByCode(ctx context.Context, code int) (*model.UserInfo, error)
- func (s *Service) IsTokenInBlackList(tokenRaw string) bool
- func (s *Service) Login(ctx context.Context, userID, systemID, password string) (err error)
- func (s *Service) NewProcRequest(reqID, userID string, kind processing.RequestKind) (processing.RequestInterface, error)
- func (s *Service) Register(ctx context.Context, user *model.UserCreateRequest, systemID, reqID string) (err error)
- func (s *Service) VerifyAccess(userID, tokenString string) error
- func (s *Service) VerifyAndGetTokenDetails(userID, accessToken, refreshToken string) (*TokenDetails, error)
- func (s *Service) VerifyToken(userID, tokenString string, tokenType TokenType) (*jwt.Token, error)
- type TokenClaims
- type TokenDetails
- type TokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Infra *infrastructure.Infra Proc *processing.Proc Cache *cache.Cache }
func NewService ¶
func NewService(infra *infrastructure.Infra, p *processing.Proc) *Service
func (*Service) AddTokenInBlackList ¶
func (*Service) CreateToken ¶
func (s *Service) CreateToken(userID string) (*TokenDetails, error)
func (*Service) ExtractToken ¶
func (*Service) ExtractTokenMetadata ¶
func (s *Service) ExtractTokenMetadata(token *jwt.Token) (*TokenClaims, error)
func (*Service) GetTokenHash ¶
func (*Service) GroupAddUser ¶
func (*Service) GroupCreate ¶
func (*Service) GroupGetByID ¶
func (*Service) GroupGetList ¶
func (*Service) GroupRemoveUser ¶
func (*Service) InfoByCode ¶
func (*Service) IsTokenInBlackList ¶
func (*Service) NewProcRequest ¶
func (s *Service) NewProcRequest(reqID, userID string, kind processing.RequestKind) (processing.RequestInterface, error)
func (*Service) VerifyAccess ¶
func (*Service) VerifyAndGetTokenDetails ¶
func (s *Service) VerifyAndGetTokenDetails(userID, accessToken, refreshToken string) (*TokenDetails, error)
type TokenClaims ¶
type TokenClaims struct { TokenType TokenType `json:"type"` jwt.StandardClaims }
type TokenDetails ¶
Click to show internal directories.
Click to hide internal directories.