proxy

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashProxyID

func HashProxyID(normalized string) string

HashProxyID returns a stable hash of a normalized proxy URL.

func HostPortForURL

func HostPortForURL(target *url.URL) string

HostPortForURL returns host:port with defaults based on scheme.

func LogFields

func LogFields(route Route) []any

LogFields returns structured log fields for a route.

func NormalizeProxyURL

func NormalizeProxyURL(proxyURL *url.URL) string

NormalizeProxyURL returns a redacted, normalized proxy URL string.

Types

type IdentityRecord

type IdentityRecord struct {
	ProxyID     string `json:"proxy_id"`
	ProxyURL    string `json:"proxy_url"`
	ProxySource string `json:"proxy_source"`
}

IdentityRecord maps proxy IDs to redacted URLs and sources.

func BuildIdentityMap

func BuildIdentityMap(routes []Route) []IdentityRecord

BuildIdentityMap returns a de-duplicated list of proxy identity records.

type Route

type Route struct {
	Kind            RouteKind
	Name            string
	TargetURL       *url.URL
	TargetHostPort  string
	ProxyURL        *url.URL
	ProxySource     config.ProxySource
	RouteMode       RouteMode
	ProxyID         string
	ProxyURLRedact  string
	ProxyHostPort   string
	ProxyURLPresent bool
}

Route captures resolved proxy metadata for an outbound route.

func ResolveRoute

func ResolveRoute(kind RouteKind, name string, target *url.URL, proxyURL *url.URL, proxySource config.ProxySource, lookupEnv func(string) (string, bool)) Route

ResolveRoute determines the effective proxy route metadata.

type RouteKind

type RouteKind string

RouteKind describes the type of outbound route.

const (
	RouteKindControlPlane RouteKind = "control_plane"
	RouteKindMCPChannel   RouteKind = "mcp_channel"
	RouteKindHarpoon      RouteKind = "harpoon_target"
)

type RouteMode

type RouteMode string

RouteMode captures whether a route is direct or proxied.

const (
	RouteModeDirect RouteMode = "direct"
	RouteModeProxy  RouteMode = "proxy"
)

type RouteSummary

type RouteSummary struct {
	Kind        string `json:"kind"`
	Name        string `json:"name"`
	Target      string `json:"target,omitempty"`
	RouteMode   string `json:"route_mode"`
	ProxySource string `json:"proxy_source"`
	ProxyURL    string `json:"proxy_url,omitempty"`
	ProxyID     string `json:"proxy_id,omitempty"`
}

RouteSummary is a JSON-friendly representation of a route.

func Summary

func Summary(route Route) RouteSummary

Summary converts a Route into a JSON-friendly summary.

Jump to

Keyboard shortcuts

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