Documentation
¶
Index ¶
- Constants
- Variables
- type AWSSQSConfig
- type AlertConfig
- type ClickHouseConfig
- type Config
- func (c *Config) ConfigFilePath() string
- func (c *Config) GetPortalConfig() portal.PortalConfig
- func (c *Config) GetService() (ServiceType, error)
- func (c *Config) InitDefaults()
- func (c *Config) MustGetService() ServiceType
- func (c *Config) ToMigratorOpts() migrator.MigrationOpts
- func (c *Config) ToTelemetryApplicationInfo() telemetry.ApplicationInfo
- func (c *Config) Validate(flags Flags) error
- type DestinationWebhookConfig
- type DestinationsConfig
- type Flags
- type MQsConfig
- type OSInterface
- type OpenTelemetryConfig
- type OpenTelemetryTypeConfig
- type PortalConfig
- type PublishAWSSQSConfig
- type PublishMQConfig
- type PublishRabbitMQConfig
- type RabbitMQConfig
- type RedisConfig
- type ServiceType
- type TelemetryConfig
Constants ¶
View Source
const ( OTelProtocolGRPC = "grpc" OTelProtocolHTTP = "http" )
View Source
const (
Namespace = "Outpost"
)
Variables ¶
View Source
var ( ErrMismatchedServiceType = errors.New("config validation error: service type mismatch") ErrInvalidServiceType = errors.New("config validation error: invalid service type") ErrMissingRedis = errors.New("config validation error: redis configuration is required") ErrMissingLogStorage = errors.New("config validation error: log storage must be provided") ErrMissingMQs = errors.New("config validation error: message queue configuration is required") ErrMissingAESSecret = errors.New("config validation error: AES encryption secret is required") ErrInvalidPortalProxyURL = errors.New("config validation error: invalid portal proxy url") )
View Source
var ErrInvalidOTelProtocol = errors.New("config validation error: invalid OpenTelemetry protocol, must be 'grpc' or 'http'")
Functions ¶
This section is empty.
Types ¶
type AWSSQSConfig ¶
type AWSSQSConfig struct {
AccessKeyID string `yaml:"access_key_id" env:"AWS_SQS_ACCESS_KEY_ID"`
SecretAccessKey string `yaml:"secret_access_key" env:"AWS_SQS_SECRET_ACCESS_KEY"`
Region string `yaml:"region" env:"AWS_SQS_REGION"`
Endpoint string `yaml:"endpoint" env:"AWS_SQS_ENDPOINT"`
DeliveryQueue string `yaml:"delivery_queue" env:"AWS_SQS_DELIVERY_QUEUE"`
LogQueue string `yaml:"log_queue" env:"AWS_SQS_LOG_QUEUE"`
}
MQ Infrastructure configs
type AlertConfig ¶
type ClickHouseConfig ¶
type ClickHouseConfig struct {
Addr string `yaml:"addr" env:"CLICKHOUSE_ADDR"`
Username string `yaml:"username" env:"CLICKHOUSE_USERNAME"`
Password string `yaml:"password" env:"CLICKHOUSE_PASSWORD"`
Database string `yaml:"database" env:"CLICKHOUSE_DATABASE"`
}
func (*ClickHouseConfig) ToConfig ¶
func (c *ClickHouseConfig) ToConfig() *clickhouse.ClickHouseConfig
type Config ¶
type Config struct {
Service string `yaml:"service" env:"SERVICE"`
LogLevel string `yaml:"log_level" env:"LOG_LEVEL"`
AuditLog bool `yaml:"audit_log" env:"AUDIT_LOG"`
OpenTelemetry OpenTelemetryConfig `yaml:"otel"`
Telemetry TelemetryConfig `yaml:"telemetry"`
// API
APIPort int `yaml:"api_port" env:"API_PORT"`
APIKey string `yaml:"api_key" env:"API_KEY"`
APIJWTSecret string `yaml:"api_jwt_secret" env:"API_JWT_SECRET"`
GinMode string `yaml:"gin_mode" env:"GIN_MODE"`
// Application
AESEncryptionSecret string `yaml:"aes_encryption_secret" env:"AES_ENCRYPTION_SECRET"`
Topics []string `yaml:"topics" env:"TOPICS" envSeparator:","`
// Infrastructure
Redis RedisConfig `yaml:"redis"`
ClickHouse ClickHouseConfig `yaml:"clickhouse"`
PostgresURL string `yaml:"postgres" env:"POSTGRES_URL"`
MQs MQsConfig `yaml:"mqs"`
// PublishMQ
PublishMQ PublishMQConfig `yaml:"publishmq"`
// Consumers
PublishMaxConcurrency int `yaml:"publish_max_concurrency" env:"PUBLISH_MAX_CONCURRENCY"`
DeliveryMaxConcurrency int `yaml:"delivery_max_concurrency" env:"DELIVERY_MAX_CONCURRENCY"`
LogMaxConcurrency int `yaml:"log_max_concurrency" env:"LOG_MAX_CONCURRENCY"`
// Delivery Retry
RetryIntervalSeconds int `yaml:"retry_interval_seconds" env:"RETRY_INTERVAL_SECONDS"`
RetryMaxLimit int `yaml:"retry_max_limit" env:"MAX_RETRY_LIMIT"`
// Event Delivery
MaxDestinationsPerTenant int `yaml:"max_destinations_per_tenant" env:"MAX_DESTINATIONS_PER_TENANT"`
DeliveryTimeoutSeconds int `yaml:"delivery_timeout_seconds" env:"DELIVERY_TIMEOUT_SECONDS"`
// Destination Registry
DestinationMetadataPath string `yaml:"destination_metadata_path" env:"DESTINATION_METADATA_PATH"`
// Log batcher configuration
LogBatchThresholdSeconds int `yaml:"log_batch_threshold_seconds" env:"LOG_BATCH_THRESHOLD_SECONDS"`
LogBatchSize int `yaml:"log_batch_size" env:"LOG_BATCH_SIZE"`
DisableTelemetry bool `yaml:"disable_telemetry" env:"DISABLE_TELEMETRY"`
// Destinations
Destinations DestinationsConfig `yaml:"destinations"`
// Portal
Portal PortalConfig `yaml:"portal"`
// Alert
Alert AlertConfig `yaml:"alert"`
// contains filtered or unexported fields
}
func ParseWithOS ¶
func ParseWithOS(flags Flags, osInterface OSInterface) (*Config, error)
ParseWithOS parses and validates config with a custom OS interface
func ParseWithoutValidation ¶
func ParseWithoutValidation(flags Flags, osInterface OSInterface) (*Config, error)
ParseWithoutValidation parses the config without validation
func (*Config) ConfigFilePath ¶
ConfigFilePath returns the path of the config file that was used
func (*Config) GetPortalConfig ¶
func (c *Config) GetPortalConfig() portal.PortalConfig
GetPortalConfig returns the portal configuration with all necessary fields
func (*Config) GetService ¶
func (c *Config) GetService() (ServiceType, error)
GetService returns ServiceType with error checking
func (*Config) InitDefaults ¶
func (c *Config) InitDefaults()
func (*Config) MustGetService ¶
func (c *Config) MustGetService() ServiceType
MustGetService returns ServiceType without error checking - panics if called before validation
func (*Config) ToMigratorOpts ¶
func (c *Config) ToMigratorOpts() migrator.MigrationOpts
func (*Config) ToTelemetryApplicationInfo ¶
func (c *Config) ToTelemetryApplicationInfo() telemetry.ApplicationInfo
type DestinationWebhookConfig ¶
type DestinationWebhookConfig struct {
HeaderPrefix string `yaml:"header_prefix" env:"DESTINATIONS_WEBHOOK_HEADER_PREFIX"`
DisableDefaultEventIDHeader bool `yaml:"disable_default_event_id_header" env:"DESTINATIONS_WEBHOOK_DISABLE_DEFAULT_EVENT_ID_HEADER"`
DisableDefaultSignatureHeader bool `yaml:"disable_default_signature_header" env:"DESTINATIONS_WEBHOOK_DISABLE_DEFAULT_SIGNATURE_HEADER"`
DisableDefaultTimestampHeader bool `yaml:"disable_default_timestamp_header" env:"DESTINATIONS_WEBHOOK_DISABLE_DEFAULT_TIMESTAMP_HEADER"`
DisableDefaultTopicHeader bool `yaml:"disable_default_topic_header" env:"DESTINATIONS_WEBHOOK_DISABLE_DEFAULT_TOPIC_HEADER"`
SignatureContentTemplate string `yaml:"signature_content_template" env:"DESTINATIONS_WEBHOOK_SIGNATURE_CONTENT_TEMPLATE"`
SignatureHeaderTemplate string `yaml:"signature_header_template" env:"DESTINATIONS_WEBHOOK_SIGNATURE_HEADER_TEMPLATE"`
SignatureEncoding string `yaml:"signature_encoding" env:"DESTINATIONS_WEBHOOK_SIGNATURE_ENCODING"`
SignatureAlgorithm string `yaml:"signature_algorithm" env:"DESTINATIONS_WEBHOOK_SIGNATURE_ALGORITHM"`
}
type DestinationsConfig ¶
type DestinationsConfig struct {
MetadataPath string `yaml:"metadata_path" env:"DESTINATIONS_METADATA_PATH"`
Webhook DestinationWebhookConfig `yaml:"webhook"`
}
func (*DestinationsConfig) ToConfig ¶
func (c *DestinationsConfig) ToConfig() destregistrydefault.RegisterDefaultDestinationOptions
type Flags ¶
type Flags struct {
Service string
Config string // Config file path
Version bool // Print version information
}
func ParseFlags ¶
func ParseFlags() Flags
type MQsConfig ¶
type MQsConfig struct {
AWSSQS AWSSQSConfig `yaml:"aws_sqs"`
RabbitMQ RabbitMQConfig `yaml:"rabbitmq"`
}
func (MQsConfig) GetDeliveryQueueConfig ¶
func (c MQsConfig) GetDeliveryQueueConfig() *mqs.QueueConfig
func (MQsConfig) GetInfraType ¶
func (MQsConfig) GetLogQueueConfig ¶
func (c MQsConfig) GetLogQueueConfig() *mqs.QueueConfig
type OSInterface ¶
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct {
ServiceName string `yaml:"service_name" env:"OTEL_SERVICE_NAME"`
Traces OpenTelemetryTypeConfig `yaml:"traces"`
Metrics OpenTelemetryTypeConfig `yaml:"metrics"`
Logs OpenTelemetryTypeConfig `yaml:"logs"`
}
func (*OpenTelemetryConfig) GetServiceName ¶
func (c *OpenTelemetryConfig) GetServiceName() string
func (*OpenTelemetryConfig) ToConfig ¶
func (c *OpenTelemetryConfig) ToConfig() *otel.OpenTelemetryConfig
func (*OpenTelemetryConfig) Validate ¶
func (c *OpenTelemetryConfig) Validate() error
type OpenTelemetryTypeConfig ¶
type PortalConfig ¶
type PortalConfig struct {
ProxyURL string `yaml:"proxy_url" env:"PORTAL_PROXY_URL"`
RefererURL string `yaml:"referer_url" env:"PORTAL_REFERER_URL"`
FaviconURL string `yaml:"favicon_url" env:"PORTAL_FAVICON_URL"`
BrandColor string `yaml:"brand_color" env:"PORTAL_BRAND_COLOR"`
Logo string `yaml:"logo" env:"PORTAL_LOGO"`
LogoDark string `yaml:"logo_dark" env:"PORTAL_LOGO_DARK"`
OrgName string `yaml:"org_name" env:"PORTAL_ORGANIZATION_NAME"`
ForceTheme string `yaml:"force_theme" env:"PORTAL_FORCE_THEME"`
DisableOutpostBranding bool `yaml:"disable_outpost_branding" env:"PORTAL_DISABLE_OUTPOST_BRANDING"`
}
type PublishAWSSQSConfig ¶
type PublishAWSSQSConfig struct {
AccessKeyID string `yaml:"access_key_id" env:"PUBLISH_AWS_SQS_ACCESS_KEY_ID"`
SecretAccessKey string `yaml:"secret_access_key" env:"PUBLISH_AWS_SQS_SECRET_ACCESS_KEY"`
Region string `yaml:"region" env:"PUBLISH_AWS_SQS_REGION"`
Endpoint string `yaml:"endpoint" env:"PUBLISH_AWS_SQS_ENDPOINT"`
Queue string `yaml:"queue" env:"PUBLISH_AWS_SQS_QUEUE"`
}
type PublishMQConfig ¶
type PublishMQConfig struct {
AWSSQS PublishAWSSQSConfig `yaml:"aws_sqs"`
RabbitMQ PublishRabbitMQConfig `yaml:"rabbitmq"`
}
func (PublishMQConfig) GetInfraType ¶
func (c PublishMQConfig) GetInfraType() string
func (*PublishMQConfig) GetQueueConfig ¶
func (c *PublishMQConfig) GetQueueConfig() *mqs.QueueConfig
type PublishRabbitMQConfig ¶
type RabbitMQConfig ¶
type RedisConfig ¶
type RedisConfig struct {
Host string `yaml:"host" env:"REDIS_HOST"`
Port int `yaml:"port" env:"REDIS_PORT"`
Password string `yaml:"password" env:"REDIS_PASSWORD"`
Database int `yaml:"database" env:"REDIS_DATABASE"`
}
func (*RedisConfig) ToConfig ¶
func (c *RedisConfig) ToConfig() *redis.RedisConfig
type ServiceType ¶
type ServiceType int
const ( ServiceTypeAll ServiceType = iota ServiceTypeAPI ServiceTypeLog ServiceTypeDelivery )
func ServiceTypeFromString ¶
func ServiceTypeFromString(s string) (ServiceType, error)
func (ServiceType) String ¶
func (s ServiceType) String() string
type TelemetryConfig ¶
type TelemetryConfig struct {
Disabled bool `yaml:"disabled" env:"DISABLE_TELEMETRY"`
BatchSize int `yaml:"batch_size" env:"TELEMETRY_BATCH_SIZE"`
BatchInterval int `yaml:"batch_interval" env:"TELEMETRY_BATCH_INTERVAL"`
HookdeckSourceURL string `yaml:"hookdeck_source_url" env:"TELEMETRY_HOOKDECK_SOURCE_URL"`
SentryDSN string `yaml:"sentry_dsn" env:"TELEMETRY_SENTRY_DSN"`
}
func (*TelemetryConfig) ToTelemetryConfig ¶
func (c *TelemetryConfig) ToTelemetryConfig() telemetry.TelemetryConfig
Click to show internal directories.
Click to hide internal directories.