services

package
v0.0.0-...-54cae78 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("grpc element not found")
)

Functions

func DiagContext

func DiagContext() context.Context

func DiagStreamClientInterceptor

func DiagStreamClientInterceptor() grpc.StreamClientInterceptor

func DiagUnaryClientInterceptor

func DiagUnaryClientInterceptor() grpc.UnaryClientInterceptor

func IsTemporary

func IsTemporary(err error) bool

IsTemporary returns true if err is temporary.

func MetadataStreamInterceptor

func MetadataStreamInterceptor(md map[string][]string) grpc.StreamClientInterceptor

func MetadataUnaryInterceptor

func MetadataUnaryInterceptor(md map[string][]string) grpc.UnaryClientInterceptor

Types

type ConnectionOptions

type ConnectionOptions struct {
	Host      string
	Authority string
	Metadata  map[string][]string
}

func NewConnectionOpts

func NewConnectionOpts(target string) (*ConnectionOptions, error)

type DiagInfo

type DiagInfo struct {
	Duration time.Duration
	RespSize int
	ReqSize  int
}

func ExtractDiagInfo

func ExtractDiagInfo(ctx context.Context) *DiagInfo

type FieldWalker

type FieldWalker struct {
	// contains filtered or unexported fields
}

FieldWalker walks fields message fields tree calling func for every field

func NewFieldWalker

func NewFieldWalker() *FieldWalker

func (*FieldWalker) Walk

func (fw *FieldWalker) Walk(md *desc.MessageDescriptor, walkFn func(*desc.FieldDescriptor))

type GrpcConnFactory

type GrpcConnFactory struct {
	// contains filtered or unexported fields
}

func NewGrpcConnFactory

func NewGrpcConnFactory() *GrpcConnFactory

func (*GrpcConnFactory) Close

func (f *GrpcConnFactory) Close() error

func (*GrpcConnFactory) CloseConn

func (f *GrpcConnFactory) CloseConn(target string) error

func (*GrpcConnFactory) GetConn

func (f *GrpcConnFactory) GetConn(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func (*GrpcConnFactory) GetConnContext

func (f *GrpcConnFactory) GetConnContext(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

type ServiceCaller

type ServiceCaller struct {
	// contains filtered or unexported fields
}

func NewServiceCaller

func NewServiceCaller(connFact *GrpcConnFactory) *ServiceCaller

func (*ServiceCaller) CallJSON

func (sc *ServiceCaller) CallJSON(ctx context.Context, serviceTarget string, methodDesc *desc.MethodDescriptor, reqJSON []byte, callOpts ...grpc.CallOption) ([]byte, error)

func (*ServiceCaller) CallServerStream

func (sc *ServiceCaller) CallServerStream(ctx context.Context, serviceTarget string, methodDesc *desc.MethodDescriptor, reqJSON []byte, callOpts ...grpc.CallOption) (chan []byte, chan error)

type ServiceMeta

type ServiceMeta struct {
	Name    string
	Methods []*desc.MethodDescriptor
	File    *desc.FileDescriptor
}

type ServiceMetaData

type ServiceMetaData struct {
	// contains filtered or unexported fields
}

func NewServiceMetaData

func NewServiceMetaData(connFact *GrpcConnFactory) *ServiceMetaData

func (*ServiceMetaData) GetFileDescriptor

func (s *ServiceMetaData) GetFileDescriptor(target, serviceName string) (*desc.FileDescriptor, error)

func (*ServiceMetaData) GetMethodDescriptor

func (s *ServiceMetaData) GetMethodDescriptor(target, service, methodName string) (*desc.MethodDescriptor, error)

func (*ServiceMetaData) GetOutputMessageDescriptor

func (s *ServiceMetaData) GetOutputMessageDescriptor(target, service, methodName string) (*desc.MessageDescriptor, error)

func (*ServiceMetaData) GetOutputMessageDescriptorParse

func (s *ServiceMetaData) GetOutputMessageDescriptorParse(target, fullMethodName string) (*desc.MessageDescriptor, error)

func (*ServiceMetaData) GetServiceMetaDataList

func (s *ServiceMetaData) GetServiceMetaDataList(target string, deadline int) ([]*ServiceMeta, error)

Jump to

Keyboard shortcuts

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