Documentation
¶
Overview ¶
Package config provides unified service configuration type aliases.
The actual types are defined in the gateway package to avoid import cycles. This file provides type aliases for backward compatibility and convenience.
Index ¶
- Constants
- type EndpointHydratorConfig
- type EnvConfigError
- type GatewayConfig
- type LatencyProfileConfig
- type LoggerConfig
- type MessagingConfig
- type MetricsConfig
- type RouterConfig
- type ServiceConfig
- type ServiceDefaults
- type ServiceFallbackConfig
- type ServiceHealthCheckOverride
- type ServiceLatencyConfig
- type ServiceObservationConfig
- type ServiceProbationConfig
- type ServiceReputationConfig
- type ServiceRetryConfig
- type ServiceTieredSelectionConfig
- type ServiceType
- type UnifiedServicesConfig
Constants ¶
const ( ServiceTypeEVM = gateway.ServiceTypeEVM ServiceTypeSolana = gateway.ServiceTypeSolana ServiceTypeCosmos = gateway.ServiceTypeCosmos ServiceTypeGeneric = gateway.ServiceTypeGeneric ServiceTypePassthrough = gateway.ServiceTypePassthrough )
ServiceType constants re-exported from gateway package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointHydratorConfig ¶
type EndpointHydratorConfig struct {
// List of service IDs to disable QoS checks for.
// By default all configured service IDs will be checked unless specified here.
// Startup will error if a service ID is specified here that is not in the protocol's configured service IDs.
// Primarily just used for testing & development.
QoSDisabledServiceIDs []protocol.ServiceID `yaml:"qos_disabled_service_ids"`
// Interval between hydrator runs during which endpoint checks are performed
RunInterval time.Duration `yaml:"run_interval_ms"`
// Maximum number of concurrent endpoint check workers for performance tuning
MaxEndpointCheckWorkers int `yaml:"max_endpoint_check_workers"`
}
EndpointHydratorConfig stores configuration settings for running an Endpoint Hydrator instance to collect observations about service endpoints. The hydrator will not start without specified service IDs.
type EnvConfigError ¶ added in v1.0.8
type EnvConfigError struct {
Description string
}
func (EnvConfigError) Error ¶ added in v1.0.8
func (c EnvConfigError) Error() string
type GatewayConfig ¶
type GatewayConfig struct {
// Shannon protocol configuration (flattened from previous shannon_config wrapper)
FullNodeConfig shannonprotocol.FullNodeConfig `yaml:"full_node_config"`
GatewayModeConfig shannonprotocol.GatewayConfig `yaml:"gateway_config"`
// Other gateway configurations
Router RouterConfig `yaml:"router_config"`
Logger LoggerConfig `yaml:"logger_config"`
Metrics MetricsConfig `yaml:"metrics_config"`
HydratorConfig EndpointHydratorConfig `yaml:"hydrator_config"`
MessagingConfig MessagingConfig `yaml:"messaging_config"`
// Global Redis configuration - used by reputation storage (when storage_type is "redis")
// and leader election for health checks.
RedisConfig *reputation.RedisConfig `yaml:"redis_config,omitempty"`
}
GatewayConfig contains all configuration details needed to operate a gateway, parsed from a YAML config file. The config structure is flattened - full_node_config and gateway_config are at root level.
func LoadGatewayConfigFromEnv ¶ added in v1.0.8
func LoadGatewayConfigFromEnv() (GatewayConfig, error)
func LoadGatewayConfigFromYAML ¶
func LoadGatewayConfigFromYAML(path string) (GatewayConfig, error)
LoadGatewayConfigFromYAML reads a YAML configuration file from the specified path and unmarshals its content into a GatewayConfig instance.
func (*GatewayConfig) GetGatewayConfig ¶
func (c *GatewayConfig) GetGatewayConfig() *shannon.ShannonGatewayConfig
GetGatewayConfig is an alias for GetShannonConfig for backward compatibility. Deprecated: Use GetShannonConfig instead.
func (*GatewayConfig) GetRouterConfig ¶
func (c *GatewayConfig) GetRouterConfig() RouterConfig
func (*GatewayConfig) GetShannonConfig ¶ added in v1.0.10
func (c *GatewayConfig) GetShannonConfig() *shannon.ShannonGatewayConfig
GetShannonConfig returns a ShannonGatewayConfig constructed from the flattened config fields. This maintains compatibility with code that expects the old nested structure.
type LatencyProfileConfig ¶ added in v1.0.10
type LatencyProfileConfig = gateway.LatencyProfileConfig
LatencyProfileConfig defines latency thresholds for a category of services.
type LoggerConfig ¶
type LoggerConfig struct {
// Level sets the minimum log level. Valid values are:
// "debug", "info", "warn", "error"
Level string `yaml:"level"`
}
LoggerConfig contains logger configuration settings
func (LoggerConfig) Validate ¶
func (c LoggerConfig) Validate() error
Validate ensures the logger configuration is valid
type MessagingConfig ¶
type MessagingConfig struct{}
TODO_MVP(@adshmh): add messaging system(s) configuration settings to the MessagingConfig placeholder struct.
MessagingConfig holds the configuration settings for the messaging system(s), e.g. NATS, REDIS, used by PATH.
type MetricsConfig ¶ added in v1.0.10
type MetricsConfig struct {
// PrometheusAddr is the address at which the Prometheus metrics server will listen
// Default: ":9090"
PrometheusAddr string `yaml:"prometheus_addr"`
// PprofAddr is the address at which the pprof server will listen
// Default: ":6060"
PprofAddr string `yaml:"pprof_addr"`
}
MetricsConfig contains configuration for metrics and profiling servers.
type RouterConfig ¶
type RouterConfig struct {
Port int `yaml:"port"`
MaxRequestHeaderBytes int `yaml:"max_request_header_bytes"`
ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration `yaml:"write_timeout"`
IdleTimeout time.Duration `yaml:"idle_timeout"`
SystemOverheadAllowanceDuration time.Duration `yaml:"system_overhead_allowance_duration"`
// WebsocketMessageBufferSize is the buffer size for websocket message observation channels.
// Larger values use more memory but can handle higher message throughput.
// Default: 50 (prevents OOM while maintaining reasonable throughput)
WebsocketMessageBufferSize int `yaml:"websocket_message_buffer_size"`
}
RouterConfig contains server configuration settings. See default values above.
type ServiceConfig ¶ added in v1.0.10
type ServiceConfig = gateway.ServiceConfig
ServiceConfig defines configuration for a single service.
type ServiceDefaults ¶ added in v1.0.10
type ServiceDefaults = gateway.ServiceDefaults
ServiceDefaults contains default settings inherited by all services.
type ServiceFallbackConfig ¶ added in v1.0.10
type ServiceFallbackConfig = gateway.ServiceFallbackConfig
ServiceFallbackConfig holds per-service fallback endpoint configuration.
type ServiceHealthCheckOverride ¶ added in v1.0.10
type ServiceHealthCheckOverride = gateway.ServiceHealthCheckOverride
ServiceHealthCheckOverride holds per-service health check configuration overrides.
type ServiceLatencyConfig ¶ added in v1.0.10
type ServiceLatencyConfig = gateway.ServiceLatencyConfig
ServiceLatencyConfig holds per-service latency configuration.
type ServiceObservationConfig ¶ added in v1.0.10
type ServiceObservationConfig = gateway.ServiceObservationConfig
ServiceObservationConfig holds per-service observation pipeline configuration.
type ServiceProbationConfig ¶ added in v1.0.10
type ServiceProbationConfig = gateway.ServiceProbationConfig
ServiceProbationConfig holds per-service probation configuration.
type ServiceReputationConfig ¶ added in v1.0.10
type ServiceReputationConfig = gateway.ServiceReputationConfig
ServiceReputationConfig holds per-service reputation configuration.
type ServiceRetryConfig ¶ added in v1.0.10
type ServiceRetryConfig = gateway.ServiceRetryConfig
ServiceRetryConfig holds per-service retry configuration.
type ServiceTieredSelectionConfig ¶ added in v1.0.10
type ServiceTieredSelectionConfig = gateway.ServiceTieredSelectionConfig
ServiceTieredSelectionConfig holds per-service tiered selection configuration.
type ServiceType ¶ added in v1.0.10
type ServiceType = gateway.ServiceType
ServiceType defines the QoS type for a service.
type UnifiedServicesConfig ¶ added in v1.0.10
type UnifiedServicesConfig = gateway.UnifiedServicesConfig
UnifiedServicesConfig is the top-level configuration for the unified service system.