Documentation ¶
Index ¶
- func New(repository repo.UsersRepository, service *TokenService) pb.UsersServer
- type CustomClaims
- type TokenService
- type UsersService
- func (u *UsersService) Auth(ctx context.Context, ser *pb.User) (*pb.Token, error)
- func (u *UsersService) Create(ctx context.Context, req *pb.User) (*pb.Response, error)
- func (u *UsersService) Get(ctx context.Context, req *pb.User) (*pb.Response, error)
- func (u *UsersService) GetAll(ctx context.Context, req *pb.GetRequest) (*pb.Response, error)
- func (u *UsersService) Update(ctx context.Context, req *pb.User) (*pb.Response, error)
- func (u *UsersService) ValidateToken(ctx context.Context, req *pb.Token) (*pb.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(repository repo.UsersRepository, service *TokenService) pb.UsersServer
Types ¶
type CustomClaims ¶
type CustomClaims struct { User *pb.User jwt.StandardClaims }
type TokenService ¶
type TokenService struct {
// contains filtered or unexported fields
}
func NewTokenService ¶
func NewTokenService(secret string) *TokenService
func (*TokenService) Decode ¶
func (s *TokenService) Decode(token string) (*CustomClaims, error)
Decode a token string into a token object
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
func (*UsersService) GetAll ¶
func (u *UsersService) GetAll(ctx context.Context, req *pb.GetRequest) (*pb.Response, error)
func (*UsersService) ValidateToken ¶
Click to show internal directories.
Click to hide internal directories.