grpc_proxy

package
v0.0.0-...-a47d0c2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "proxy"

Name is the name registered for the proto compressor.

Variables

This section is empty.

Functions

func GetServerOptions

func GetServerOptions(director StreamDirector) []grpc.ServerOption

func TransparentHandler

func TransparentHandler(director StreamDirector) grpc.StreamHandler

TransparentHandler returns a handler that attempts to proxy all requests that are not registered in the server. The indented use here is as a transparent proxy, where the server doesn't know about the services implemented by the backends. It should be used as a `grpc.UnknownServiceHandler`.

Types

type MessageCodec

type MessageCodec interface {
	// Marshal returns the wire format of v.
	Marshal() ([]byte, error)
	// Unmarshal parses the wire format into v.
	Unmarshal(data []byte) error
}

type ProxyCodec

type ProxyCodec struct{}

ProxyCodec is a Codec implementation with protobuf. It is the default ProxyCodec for gRPC.

func (ProxyCodec) Marshal

func (ProxyCodec) Marshal(v interface{}) ([]byte, error)

func (ProxyCodec) Name

func (ProxyCodec) Name() string

func (ProxyCodec) String

func (ProxyCodec) String() string

func (ProxyCodec) Unmarshal

func (ProxyCodec) Unmarshal(data []byte, v interface{}) error

type ProxyData

type ProxyData struct {
	Data []byte
}

func (*ProxyData) Marshal

func (d *ProxyData) Marshal() ([]byte, error)

func (*ProxyData) Unmarshal

func (d *ProxyData) Unmarshal(data []byte) error

type StreamDirector

type StreamDirector func(ctx context.Context, fullMethodName string) (*grpc.ClientConn, error)

Jump to

Keyboard shortcuts

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