Documentation
¶
Index ¶
- func AgentBaseURL(serverURL *url.URL) *url.URL
- func DeriveBackendBaseURL(raw string) (string, error)
- func JoinPath(base *url.URL, elems ...string) (string, error)
- func NewAgentHTTPClient(serverURL *url.URL) *http.Client
- func ValidateBackendEndpoint(raw string) (*url.URL, error)
- func ValidateLocalServerURL(raw string) (*url.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentBaseURL ¶
AgentBaseURL returns the HTTP base URL to use when constructing request URLs. For unix socket connections the actual host is irrelevant to the transport, so we normalise to http://localhost and route via the custom dialer.
func DeriveBackendBaseURL ¶ added in v1.3.0
DeriveBackendBaseURL converts a legacy backend endpoint URL into its backend base URL. For example, "https://backend.example.com/api/v1/health/metrics" becomes "https://backend.example.com".
func NewAgentHTTPClient ¶
NewAgentHTTPClient returns an http.Client configured to reach the fleetint daemon described by serverURL. For unix socket URLs it installs a custom dialer; for TCP URLs it returns a plain client.
func ValidateBackendEndpoint ¶
ValidateBackendEndpoint validates a trusted backend endpoint. Production backends must use HTTPS. HTTP is accepted only for loopback hosts to support local development and smoke tests.
func ValidateLocalServerURL ¶
ValidateLocalServerURL validates a CLI-supplied URL for the local fleetint daemon. It accepts:
- A bare absolute path (unix socket): /run/fleetint/fleetint.sock
- A unix:// URL: unix:///run/fleetint/fleetint.sock
- HTTP/HTTPS URLs with a loopback host: http://localhost:15133
Types ¶
This section is empty.