go-micro: github.com/micro/go-micro/proxy/grpc Index | Files

package grpc

import "github.com/micro/go-micro/proxy/grpc"

Package grpc transparently forwards the grpc protocol using a go-micro client.


Package Files


func NewProxy Uses

func NewProxy(opts ...proxy.Option) proxy.Proxy

NewProxy returns a new grpc proxy server

type Proxy Uses

type Proxy struct {

    // Endpoint specified the fixed endpoint to call.
    Endpoint string

    // The client to use for outbound requests
    Client client.Client
    // contains filtered or unexported fields

Proxy will transparently proxy requests to the backend. If no backend is specified it will call a service using the client. If the service matches the Name it will use the server.DefaultRouter.

func NewSingleHostProxy Uses

func NewSingleHostProxy(url string) *Proxy

NewSingleHostProxy returns a router which sends requests to a single backend

func (*Proxy) ProcessMessage Uses

func (p *Proxy) ProcessMessage(ctx context.Context, msg server.Message) error

ProcessMessage acts as a message exchange and forwards messages to ongoing topics TODO: should we look at p.Endpoint and only send to the local endpoint? probably

func (*Proxy) ServeRequest Uses

func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server.Response) error

ServeRequest honours the server.Proxy interface

func (*Proxy) String Uses

func (p *Proxy) String() string

Package grpc imports 8 packages (graph) and is imported by 4 packages. Updated 2020-02-08. Refresh now. Tools for package owners.