Documentation ¶
Index ¶
- Variables
- func AuthFromMD(ctx context.Context, expectedScheme string, headerAuthorize ...string) (string, error)
- func ErrorWrapper(err error) error
- func ExpectCodes(err error, cds ...codes.Code) error
- func ExpectCodesWithoutOK(err error, cds ...codes.Code) error
- func GetSessionFromContext(ctx context.Context) int64
- func GetSubjectTokenFromContext(ctx context.Context) (string, error)
- func GetTokenFromContext(ctx context.Context) (string, error)
- func HandleGRPCError(logger log.FieldLogger, err error, format string, args ...interface{}) error
- func HttpStatusCode2GrpcStatusCode(code int) codes.Code
- func NewDialOptionWithTransportCredentials(tcs credentials.TransportCredentials) []grpc.DialOption
- func StreamServerInterceptor(logger log.FieldLogger) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(logger log.FieldLogger) grpc.UnaryServerInterceptor
- type ErrorMapping
- type ErrorParser
- type HijackStream
- type MethodDescription
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JSONPBMarshaler = new(jsonpb.Marshaler) JSONPBUnmarshaler = new(jsonpb.Unmarshaler) )
View Source
var (
ErrFailedToRecvMessage = errors.New("failed to recv message")
)
View Source
var (
InvalidFullMethodName = errors.New("invalid full method name")
)
Functions ¶
func AuthFromMD ¶
func AuthFromMD(ctx context.Context, expectedScheme string, headerAuthorize ...string) (string, error)
github.com/grpc-ecosystem/go-grpc-middleware/auth/metadata.go:AuthFromMD
func ErrorWrapper ¶ added in v1.1.16
func ExpectCodesWithoutOK ¶ added in v1.1.16
func GetSessionFromContext ¶ added in v0.99.2
func HandleGRPCError ¶
func HandleGRPCError(logger log.FieldLogger, err error, format string, args ...interface{}) error
func NewDialOptionWithTransportCredentials ¶ added in v1.1.16
func NewDialOptionWithTransportCredentials(tcs credentials.TransportCredentials) []grpc.DialOption
func StreamServerInterceptor ¶
func StreamServerInterceptor(logger log.FieldLogger) grpc.StreamServerInterceptor
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(logger log.FieldLogger) grpc.UnaryServerInterceptor
Types ¶
type ErrorMapping ¶ added in v1.2.0
type ErrorParser ¶ added in v1.2.0
type ErrorParser struct {
// contains filtered or unexported fields
}
func NewErrorParser ¶ added in v1.2.0
func NewErrorParser(em ErrorMapping) *ErrorParser
func (*ErrorParser) ParseError ¶ added in v1.2.0
func (ep *ErrorParser) ParseError(err error) error
type HijackStream ¶ added in v1.0.0
type HijackStream struct { deviced_pb.DevicedService_ConnectClient // contains filtered or unexported fields }
func NewHijackStream ¶ added in v1.0.0
func NewHijackStream(stm deviced_pb.DevicedService_ConnectClient, on_recv func(*HijackStream, *deviced_pb.ConnectRequest) error) *HijackStream
func (*HijackStream) Recv ¶ added in v1.0.0
func (self *HijackStream) Recv() (*deviced_pb.ConnectRequest, error)
func (*HijackStream) RecvChan ¶ added in v1.0.0
func (self *HijackStream) RecvChan() chan *deviced_pb.ConnectRequest
type MethodDescription ¶
func ParseMethodDescription ¶
func ParseMethodDescription(fullMethodName string) (*MethodDescription, error)
Click to show internal directories.
Click to hide internal directories.