caller

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrTransient

func IsErrTransient(err error) bool

IsErrTransient returns true if err is t.

Types

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 FileDescCache added in v1.12.0

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

FileDescCache stores unique processed protobuf file descriptors to reuse them in other parts of the app

func NewFileDescCache added in v1.12.0

func NewFileDescCache(files []*desc.FileDescriptor) *FileDescCache

func (*FileDescCache) Add added in v1.12.0

func (fdc *FileDescCache) Add(d *desc.FileDescriptor)

func (*FileDescCache) Files added in v1.12.0

func (fdc *FileDescCache) Files() []*desc.FileDescriptor

type GrpcReflectVersion added in v1.18.0

type GrpcReflectVersion int
const (
	GrpcReflectV1Alpha GrpcReflectVersion = iota
	// automatically determine which grpc reflection version to use
	GrpcReflectAuto
)

func ParseGrpcReflectVersion added in v1.18.0

func ParseGrpcReflectVersion(s string) GrpcReflectVersion

type MsgFormat added in v1.5.0

type MsgFormat int

Proto message format

const (
	JSON MsgFormat = iota
	Text
)

func ParseMsgFormat added in v1.6.0

func ParseMsgFormat(s string) MsgFormat

func (MsgFormat) String added in v1.5.0

func (f MsgFormat) String() string

type ServiceCaller

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

func NewServiceCaller

func NewServiceCaller(connFact *rpc.GrpcConnFactory, inMsgFormat, outMsgFormat MsgFormat, fdescCache *FileDescCache, outJsonNames bool) *ServiceCaller

func (*ServiceCaller) CallClientStream added in v1.2.0

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

CallClientStream allows calling unary or client stream methods as they both return only a single result

func (*ServiceCaller) CallStream added in v1.2.0

func (sc *ServiceCaller) CallStream(ctx context.Context, serviceTarget string, methodDesc *desc.MethodDescriptor, messages [][]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 interface {
	GetServiceMetaDataList(context.Context) (ServiceMetaList, error)
	GetAdditionalFiles() ([]*desc.FileDescriptor, error)
}

func NewServiceMetaData

func NewServiceMetaData(cfg *ServiceMetaDataConfig) ServiceMetaData

NewServiceMetaData returns new instance of ServiceMetaData that reads service metadata by calling grpc Reflection service of the target

func NewServiceMetadataProto added in v1.3.0

func NewServiceMetadataProto(protoPath, protoImports []string) ServiceMetaData

NewServiceMetadataProto returns new instance of ServiceMetaData that reads service metadata from proto files on disk. protoPath - proto files or directories of proto files protoImports - additional directories to search for proto files dependencies

type ServiceMetaDataConfig added in v1.18.0

type ServiceMetaDataConfig struct {
	ConnFact       *rpc.GrpcConnFactory
	Target         string
	ProtoImports   []string
	Deadline       int
	ReflectVersion GrpcReflectVersion
}

type ServiceMetaList added in v1.13.0

type ServiceMetaList []*ServiceMeta

func (ServiceMetaList) Files added in v1.13.0

func (l ServiceMetaList) Files() []*desc.FileDescriptor

Jump to

Keyboard shortcuts

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