proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshAPI = "/refresh"
	SystemPort = 7789
)

Variables

View Source
var LogLevel = consts.DebugLogLevel + 1
View Source
var OrigDstHeader = "x-envoy-original-dst-host"

Functions

This section is empty.

Types

type Peer

type Peer = peers.Peer

Peer is kept for backward compatibility, but now uses peers.Peer from pkg/peers

type RequestAdapter

type RequestAdapter interface {
	// ParseRequest normalizes raw HTTP headers into a ParsedRequest.
	// Each data plane should convert its native header format to map[string]string
	// (using HTTP/2 pseudo-header keys: :scheme, :authority, :path, plus "host"),
	// then call this method to get normalized request info.
	ParseRequest(headers map[string]string) *adapters.ParsedRequest
	// Map extracts sandbox ID, port and other information from the request
	Map(req *adapters.ParsedRequest) (
		sandboxID string, sandboxPort int, extraHeaders map[string]string, err error)
	// IsSandboxRequest determines whether the request is a sandbox request. If it returns true, it's a sandbox request,
	// otherwise it's an API Server request. Only sandbox requests are processed by the Adapter.
	IsSandboxRequest(authority, path string, port int) bool
	// Entry gets the entry address of the service process, such as "127.0.0.1:8080"
	Entry() string
}

RequestAdapter is used to register the mapping from business-side sandbox requests to internal logic

type Route

type Route struct {
	IP              string    `json:"ip"`
	ID              string    `json:"id"`
	UID             types.UID `json:"uid"`
	Owner           string    `json:"owner"`
	State           string    `json:"state"`
	ResourceVersion string    `json:"resourceVersion"`
}

Route represents an internal sandbox routing rule

type Server

type Server struct {
	LBEntry string // entry of load balancer, usually a service
	// contains filtered or unexported fields
}

Server implements the Envoy external processing server. https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ext_proc/v3/external_processor.proto

func NewServer

func NewServer(opts config.SandboxManagerOptions) *Server

func (*Server) DeleteRoute

func (s *Server) DeleteRoute(id string)

func (*Server) ListPeers

func (s *Server) ListPeers() []peers.Peer

func (*Server) ListRoutes

func (s *Server) ListRoutes() []Route

func (*Server) LoadRoute

func (s *Server) LoadRoute(id string) (Route, bool)

func (*Server) Process

func (*Server) Run

func (s *Server) Run() error

func (*Server) SetPeersManager added in v0.3.0

func (s *Server) SetPeersManager(p peers.Peers)

func (*Server) SetRequestAdapter added in v0.3.0

func (s *Server) SetRequestAdapter(adapter RequestAdapter)

func (*Server) SetRoute

func (s *Server) SetRoute(ctx context.Context, route Route)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

func (*Server) SyncRouteWithPeers

func (s *Server) SyncRouteWithPeers(route Route) error

Jump to

Keyboard shortcuts

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