caller

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 27 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.

func RegisterFiles

func RegisterFiles(fds ...*desc.FileDescriptor)

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 GrpcReflectVersion

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

func ParseGrpcReflectVersion

func ParseGrpcReflectVersion(s string) GrpcReflectVersion

type MsgFormat

type MsgFormat int

Proto message format

const (
	JSON MsgFormat = iota
	Text
)

func ParseMsgFormat

func ParseMsgFormat(s string) MsgFormat

func (MsgFormat) String

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, outJsonNames bool) *ServiceCaller

func (*ServiceCaller) CallClientStream

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

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

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

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

type ServiceMetaList

type ServiceMetaList []*ServiceMeta

func (ServiceMetaList) Files

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

Jump to

Keyboard shortcuts

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