proxy

package
v1.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescriptorSourceFromFileDescriptorSet

func DescriptorSourceFromFileDescriptorSet(files *descriptorpb.FileDescriptorSet) (grpcproxy.DescriptorSource, error)

DescriptorSourceFromFileDescriptorSet creates a DescriptorSource that is backed by the FileDescriptorSet.

func DescriptorSourceFromProtoset

func DescriptorSourceFromProtoset(filenames []string) (grpcproxy.DescriptorSource, error)

DescriptorSourceFromProtoset creates a DescriptorSource that is backed by the named files, whose contents are Protocol Buffer source files. The given importPaths are used to locate any imported files.

func InitProtosetSource

func InitProtosetSource(protoset []string)

Types

type MethodInvocation

type MethodInvocation struct {
	*desc.MethodDescriptor
	*dynamic.Message
}

MethodInvocation contains a method and a message used to invoke an RPC

type Proxy

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

func NewProxy

func NewProxy() *Proxy

NewProxy creates a new client

func (*Proxy) Call

func (p *Proxy) Call(ctx context.Context, serviceName, methodName string, message []byte, md *metadata.MD) ([]byte, error)

Call performs the gRPC call after doing reflection to obtain type information.

func (*Proxy) Connect

func (p *Proxy) Connect(ctx context.Context, target *url.URL) error

Connect opens a connection to target.

type Reflector

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

func NewReflector

func NewReflector(client *grpcreflect.Client) *Reflector

NewReflector creates a new Reflector from the reflection client

func (*Reflector) CreateInvocation

func (r *Reflector) CreateInvocation(ctx context.Context, serviceName, methodName string, input []byte) (*MethodInvocation, error)

CreateInvocation creates a MethodInvocation by performing reflection

Jump to

Keyboard shortcuts

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