config

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFormatUnset      = runtimeconfig.LogFormatUnset
	LogFormatStructText = runtimeconfig.LogFormatStructText
	LogFormatJSON       = runtimeconfig.LogFormatJSON
)
View Source
const (
	MCPTransportHTTPStreamable = runtimeconfig.MCPTransportHTTPStreamable
	MCPTransportStdio          = runtimeconfig.MCPTransportStdio
	MCPTransportInMemory       = runtimeconfig.MCPTransportInMemory
)
View Source
const (
	HarpoonTransportHTTPStreamable = runtimeconfig.HarpoonTransportHTTPStreamable
	DefaultHarpoonMaxResponseBytes = runtimeconfig.DefaultHarpoonMaxResponseBytes
	DefaultHarpoonMaxRedirects     = runtimeconfig.DefaultHarpoonMaxRedirects
)
View Source
const (
	ProxySourceNone        = runtimeconfig.ProxySourceNone
	ProxySourceEnvironment = runtimeconfig.ProxySourceEnvironment
	ProxySourceIgnored     = runtimeconfig.ProxySourceIgnored
)
View Source
const (
	ProfileEnvName     = runtimeconfig.ProfileEnvName
	ProfileFileEnvName = runtimeconfig.ProfileFileEnvName
	ProfileDirEnvName  = runtimeconfig.ProfileDirEnvName
	ConfigEnvName      = runtimeconfig.ConfigEnvName
)

Variables

This section is empty.

Functions

func DefaultProfileDir

func DefaultProfileDir(lookupEnv func(string) (string, bool)) (string, error)

func EnvProxyConfigured

func EnvProxyConfigured(lookupEnv func(string) (string, bool)) bool

func NormalizeControlPlaneURLPath

func NormalizeControlPlaneURLPath(raw string) (string, error)

func NormalizeExtraHeaders added in v0.0.11

func NormalizeExtraHeaders(source string, headers map[string]string) (map[string]string, error)

func ProfilePath

func ProfilePath(name string, explicitDir string, lookupEnv func(string) (string, bool)) (string, string, error)

func ProxyLogFields

func ProxyLogFields(proxyURL *url.URL, source ProxySource) []any

func RedactProxyURL

func RedactProxyURL(proxyURL *url.URL) string

func RegisterAdminFlags

func RegisterAdminFlags(fs *pflag.FlagSet)

RegisterAdminFlags attaches admin/tunnel-management flags to the provided flag set.

func RegisterFlags

func RegisterFlags(fs *pflag.FlagSet)

RegisterFlags delegates every shared flag to runtimeconfig and adds only full-client extensions.

func ResolveControlPlanePath

func ResolveControlPlanePath(baseURL *url.URL, urlPath, routePath string) *url.URL

func ResolveProfileDir

func ResolveProfileDir(explicitDir string, lookupEnv func(string) (string, bool)) (string, error)

func ValidateControlPlaneAPIKey added in v0.0.11

func ValidateControlPlaneAPIKey(key string) error

func ValidateProfileBytes

func ValidateProfileBytes(path string, data []byte) error

func ValidateProfileFile

func ValidateProfileFile(path string) error

func ValidateProfileName

func ValidateProfileName(name string) error

func ValidateTunnelID

func ValidateTunnelID(tunnelID string) error

func WriteUsage

func WriteUsage(fs *pflag.FlagSet, w io.Writer)

WriteUsage keeps the full-client presentation while shared flag help comes from the single runtimeconfig registry.

Types

type AdminConfig

type AdminConfig struct {
	BaseURL         *url.URL
	URLPath         string
	AdminKey        string
	OrganizationIDs []string
	WorkspaceIDs    []string
	TLS             *tlsconfig.Bundle
}

AdminConfig captures the options required for tunnel management API calls.

The admin CLI surface is intentionally narrower than the runtime client configuration: it only needs a base URL, an admin API key, and the scoped organization/workspace headers required by the control plane.

func LoadAdminConfig

func LoadAdminConfig(fs *pflag.FlagSet, lookupEnv func(string) (string, bool)) (*AdminConfig, error)

LoadAdminConfig builds an AdminConfig from the provided flag set and environment.

It enforces that an admin API key is present and that at least one of organization_id or workspace_id is supplied to scope the request context.

type AdminUIConfig

type AdminUIConfig struct {
	AllowRemote     bool
	OpenBrowser     bool
	LogBufferEvents int
}

AdminUIConfig contains full-client-only UI settings.

type CloudflaredConfig added in v0.0.11

type CloudflaredConfig = runtimeconfig.CloudflaredSettings

type Config

type Config struct {
	ControlPlane ControlPlaneConfig
	Logging      LoggingConfig
	Health       HealthConfig
	Process      ProcessConfig
	Cloudflared  CloudflaredConfig
	MCP          MCPConfig
	AdminUI      AdminUIConfig
	Harpoon      HarpoonConfig
	ProxyHealth  ProxyHealthConfig
	TLS          *tlsconfig.Bundle
	Runtime      RuntimeConfig
}

Config is the full-client superset. Shared runtime fields stay source compatible here, but their values are loaded exactly once by runtimeconfig. The one explicit adapter below is covered by parity tests.

func Load

func Load(args []string, lookupEnv func(string) (string, bool)) (*Config, error)

Load builds the full-client superset from the canonical runtime loader plus the small set of full-only extension settings.

func LoadFromFlagSet

func LoadFromFlagSet(fs *pflag.FlagSet, lookupEnv func(string) (string, bool)) (*Config, error)

LoadFromFlagSet loads shared production behavior once in runtimeconfig, then applies the full-client-only extension values against the same effective flag > environment > profile > default lookup.

type ConfigSource

type ConfigSource = runtimeconfig.ConfigSource

Profile selection and validation are shared production behavior. Keep this package as a source-compatible forwarding surface for full-client callers.

func ResolveConfigSource

func ResolveConfigSource(fs *pflag.FlagSet, lookupEnv func(string) (string, bool)) (ConfigSource, error)

type ControlPlaneConfig

type ControlPlaneConfig = runtimeconfig.ControlPlaneConfig

type HarpoonConfig

type HarpoonConfig struct {
	AllowPlaintextHTTP   bool
	MaxResponseBytes     int
	MaxRedirects         int
	AdditionalTransports []HarpoonTransportKind
	Targets              []HarpoonTarget
	CapturePayloads      bool
	HostClassifier       HarpoonHostClassifierConfig
	HTTPProxy            *url.URL
	HTTPProxySource      ProxySource
}

HarpoonConfig keeps the full-client-only payload-capture switch alongside runtime-owned shared Harpoon settings for source compatibility.

func (HarpoonConfig) AdditionalTransportEnabled

func (h HarpoonConfig) AdditionalTransportEnabled(kind HarpoonTransportKind) bool

type HarpoonTarget

type HarpoonTarget = runtimeconfig.HarpoonTarget

type HarpoonTransportKind

type HarpoonTransportKind = runtimeconfig.HarpoonTransportKind

type HealthConfig

type HealthConfig = runtimeconfig.HealthConfig

type LogFormat

type LogFormat = runtimeconfig.LogFormat

Shared production types are owned by runtimeconfig. These aliases preserve the historical pkg/config API for full-client callers.

func ParseLogFormat

func ParseLogFormat(raw string) (LogFormat, error)

type LoggingConfig

type LoggingConfig = runtimeconfig.LoggingConfig

type MCPChannelBinding

type MCPChannelBinding = runtimeconfig.MCPChannelBinding

type MCPConfig

type MCPConfig = runtimeconfig.MCPConfig

type MCPTransportKind

type MCPTransportKind = runtimeconfig.MCPTransportKind

type ProcessConfig

type ProcessConfig = runtimeconfig.ProcessConfig

type ProxyHealthConfig

type ProxyHealthConfig struct {
	CheckInterval time.Duration
}

ProxyHealthConfig contains the full-client-only proxy connectivity probe.

type ProxySource

type ProxySource = runtimeconfig.ProxySource

type RuntimeConfig

type RuntimeConfig = runtimeconfig.RuntimeConfig

Jump to

Keyboard shortcuts

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