Documentation ¶
Index ¶
- Constants
- func NewAuthStreamUnaryServerInterceptor() grpc.StreamServerInterceptor
- func NewAuthUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func NewClientCredential(ak, sk string) metadata.MD
- type GrpcAuther
- func (a *GrpcAuther) GetClientCredentialsFromMeta(md metadata.MD) (clientId, clientSecret string)
- func (a *GrpcAuther) StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func (a *GrpcAuther) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
Constants ¶
View Source
const ( ClientHeaderAccessKey = "client-id" ClientSecretAccessKey = "client-secret" )
Variables ¶
This section is empty.
Functions ¶
func NewAuthStreamUnaryServerInterceptor ¶
func NewAuthStreamUnaryServerInterceptor() grpc.StreamServerInterceptor
func NewAuthUnaryServerInterceptor ¶
func NewAuthUnaryServerInterceptor() grpc.UnaryServerInterceptor
func NewClientCredential ¶
Types ¶
type GrpcAuther ¶
type GrpcAuther struct { }
func (*GrpcAuther) GetClientCredentialsFromMeta ¶
func (a *GrpcAuther) GetClientCredentialsFromMeta(md metadata.MD) (clientId, clientSecret string)
func (*GrpcAuther) StreamServerInterceptor ¶
func (a *GrpcAuther) StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
stream interceptor
func (*GrpcAuther) UnaryServerInterceptor ¶
func (a *GrpcAuther) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
request response 拦截器
Click to show internal directories.
Click to hide internal directories.