Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { // URL pattern to call (can include path parameters) - optional, defaults to endpoint path URLPattern string `yaml:"url_pattern,omitempty"` // Encoding for this specific backend (overrides endpoint encoding) Encoding string `yaml:"encoding"` // Host for this backend Host string `yaml:"host"` // Headers to remove before making the request to this backend RemoveHeaders []string `yaml:"remove_headers,omitempty"` // Response transformations Group string `yaml:"group,omitempty"` Target string `yaml:"target,omitempty"` Allow []string `yaml:"allow,omitempty"` Deny []string `yaml:"deny,omitempty"` Mapping map[string]string `yaml:"mapping,omitempty"` Concat string `yaml:"concat,omitempty"` }
Backend represents a backend service configuration
type Config ¶
type Config struct { // Global timeout for all endpoints (can be overridden per endpoint) Timeout time.Duration `yaml:"timeout"` // Service configuration Port string `yaml:"port"` LogLevel string `yaml:"log_level"` LogFormat string `yaml:"log_format"` ShutdownTimeout time.Duration `yaml:"shutdown_timeout"` // OpenTelemetry configuration TracingEnabled bool `yaml:"tracing_enabled"` TracingEndpoint string `yaml:"tracing_endpoint"` MetricsEnabled bool `yaml:"metrics_enabled"` ServiceName string `yaml:"service_name"` // Endpoints configuration Endpoints []Endpoint `yaml:"endpoints"` }
Config represents the entire service configuration
func LoadConfig ¶
LoadConfig loads configuration from a YAML file
func LoadConfigFromEnv ¶
LoadConfigFromEnv loads configuration from environment variables
type Endpoint ¶
type Endpoint struct { // Endpoint path (can include path parameters like {user}) Endpoint string `yaml:"endpoint"` // HTTP method (GET, POST, PUT, DELETE, etc.) Method string `yaml:"method"` // Timeout for this specific endpoint (overrides global timeout) Timeout time.Duration `yaml:"timeout"` // Default encoding for backends (json, xml, yaml) Encoding string `yaml:"encoding"` // Backend services to aggregate Backends []Backend `yaml:"backends"` }
Endpoint represents a single API endpoint configuration
Click to show internal directories.
Click to hide internal directories.