Documentation
¶
Index ¶
- Constants
- Variables
- type Peer
- type RequestAdapter
- type Route
- type Server
- func (s *Server) DeleteRoute(id string)
- func (s *Server) ListPeers() []peers.Peer
- func (s *Server) ListRoutes() []Route
- func (s *Server) LoadRoute(id string) (Route, bool)
- func (s *Server) Process(srv extProcPb.ExternalProcessor_ProcessServer) error
- func (s *Server) Run() error
- func (s *Server) SetPeersManager(p peers.Peers)
- func (s *Server) SetRequestAdapter(adapter RequestAdapter)
- func (s *Server) SetRoute(ctx context.Context, route Route)
- func (s *Server) Stop(ctx context.Context)
- func (s *Server) SyncRouteWithPeers(route Route) error
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 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 (*Server) ListRoutes ¶
func (*Server) Process ¶
func (s *Server) Process(srv extProcPb.ExternalProcessor_ProcessServer) error
func (*Server) SetPeersManager ¶ added in v0.3.0
func (*Server) SetRequestAdapter ¶ added in v0.3.0
func (s *Server) SetRequestAdapter(adapter RequestAdapter)
func (*Server) SyncRouteWithPeers ¶
Click to show internal directories.
Click to hide internal directories.