caller

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 30 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 added in v1.21.0

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

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

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, 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