proxy

package
v3.10.10 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

View Source
var (
	DefaultEndpoint = "localhost:9090"
)

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

Option set proxy options

func WithClient

func WithClient(c client.Client) Option

WithClient sets the client

func WithEndpoint

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

func WithRouter(r router.Router) Option

WithRouter specifies the router to use

type Options

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
}

Options for proxy

type Proxy

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

Path Synopsis
Package grpc is a grpc proxy built for the go-micro/server
Package grpc is a grpc proxy built for the go-micro/server
Package http provides a micro rpc to http proxy
Package http provides a micro rpc to http proxy
Package mucp transparently forwards the incoming request using a go-micro client.
Package mucp transparently forwards the incoming request using a go-micro client.
Package proxy is a proxy for grpc/http/mucp
Package proxy is a proxy for grpc/http/mucp

Jump to

Keyboard shortcuts

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