grpc_helper

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 GetSessionFromContext added in v0.99.2

func GetSessionFromContext(ctx context.Context) int64

func GetSubjectTokenFromContext

func GetSubjectTokenFromContext(ctx context.Context) (string, error)

func GetTokenFromContext

func GetTokenFromContext(ctx context.Context) (string, error)

func HandleGRPCError

func HandleGRPCError(logger log.FieldLogger, err error, format string, args ...interface{}) error

func HttpStatusCode2GrpcStatusCode

func HttpStatusCode2GrpcStatusCode(code int) codes.Code

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

Types

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 (*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

type MethodDescription struct {
	Package string
	Service string
	Method  string
}

func ParseMethodDescription

func ParseMethodDescription(fullMethodName string) (*MethodDescription, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL