Documentation ¶
Index ¶
- Variables
- func AuthorizationServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func GetGlobalService(k GlobalServiceKey) interface{}
- func LoggingServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func RegisterGlobalService(ctx context.Context, service interface{}) context.Context
- type GlobalServiceKey
- type GrpcMethod
- type GrpcMethodService
- type TokenMiddleware
- type UserClaims
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AuthServiceKey = GlobalServiceKey("authService") GrpcMethodsServiceKey = GlobalServiceKey("grpcMethodsService") )
View Source
var ProviderSet = wire.NewSet( NewTokenMiddleware, NewGrpMethodsService, )
Functions ¶
func AuthorizationServerInterceptor ¶
func AuthorizationServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func GetGlobalService ¶
func GetGlobalService(k GlobalServiceKey) interface{}
func LoggingServerInterceptor ¶
func LoggingServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
type GlobalServiceKey ¶
type GlobalServiceKey string
type GrpcMethod ¶
type GrpcMethod struct {
Name string
}
type GrpcMethodService ¶
type GrpcMethodService struct {
// contains filtered or unexported fields
}
func NewGrpMethodsService ¶
func NewGrpMethodsService() *GrpcMethodService
func (*GrpcMethodService) IsPublicMethod ¶
func (s *GrpcMethodService) IsPublicMethod(method string) bool
type TokenMiddleware ¶
func NewTokenMiddleware ¶
func NewTokenMiddleware( conf *config.Config, ) *TokenMiddleware
func (*TokenMiddleware) CreateToken ¶
func (t *TokenMiddleware) CreateToken(user *model.User) (string, error)
func (*TokenMiddleware) ParseToken ¶
func (t *TokenMiddleware) ParseToken(tokenString string) (*UserClaims, error)
func (*TokenMiddleware) ValidateToken ¶
func (t *TokenMiddleware) ValidateToken(ctx context.Context) (*UserClaims, error)
type UserClaims ¶
type UserClaims struct { *jwt.StandardClaims UserInfo }
Click to show internal directories.
Click to hide internal directories.