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

package proxy

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

Package proxy is a transparent proxy built on the go-micro/server

Package proxy is a transparent proxy built on the go-micro/server

Index

Package Files

options.go proxy.go

Variables

var (
    DefaultEndpoint = "localhost:9090"
)

type Option Uses

type Option func(o *Options)

func WithClient Uses

func WithClient(c client.Client) Option

WithClient sets the client

func WithEndpoint Uses

func WithEndpoint(e string) Option

WithEndpoint sets a proxy endpoint

func WithLink(name string, c client.Client) Option

WithLink sets a link for outbound requests

func WithRouter Uses

func WithRouter(r router.Router) Option

WithRouter specifies the router to use

type Options Uses

type Options struct {
    // Specific endpoint to always call
    Endpoint string
    // The default client to use
    Client client.Client
    // The default router to use
    Router router.Router
    // Extra links for different clients
    Links map[string]client.Client
}

type Proxy Uses

type Proxy interface {
    // ProcessMessage handles inbound messages
    ProcessMessage(context.Context, server.Message) error
    // ServeRequest handles inbound requests
    ServeRequest(context.Context, server.Request, server.Response) error
    // Name of the proxy protocol
    String() string
}

Proxy can be used as a proxy server for go-micro services

Directories

PathSynopsis
grpcPackage grpc transparently forwards the grpc protocol using a go-micro client.
httpPackage http provides a micro rpc to http proxy
mucpPackage mucp transparently forwards the incoming request using a go-micro client.

Package proxy imports 4 packages (graph) and is imported by 30 packages. Updated 2020-02-22. Refresh now. Tools for package owners.