Documentation
¶
Index ¶
- Constants
- Variables
- type AWSSQSConfig
- type ClickHouseConfig
- type Config
- 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
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") ErrMissingClickHouse = errors.New("config validation error: clickhouse configuration is required") 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 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"`
OpenTelemetry OpenTelemetryConfig `yaml:"open_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"`
// 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"`
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
LogBatcherDelayThresholdSeconds int `yaml:"log_batcher_delay_threshold_seconds" env:"LOG_BATCH_THRESHOLD_SECONDS"`
LogBatcherItemCountThreshold int `yaml:"log_batcher_item_count_threshold" env:"LOG_BATCH_SIZE"`
DisableTelemetry bool `yaml:"disable_telemetry" env:"DISABLE_TELEMETRY"`
// Destinations
Destinations DestinationsConfig `yaml:"destinations"`
// Portal
Portal PortalConfig `yaml:"portal"`
// 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) 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
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 ¶
func ParseFlags ¶
func ParseFlags() Flags
type MQsConfig ¶
type MQsConfig struct {
AWSSQS AWSSQSConfig `yaml:"aws_sqs"`
RabbitMQ RabbitMQConfig `yaml:"rabbitmq"`
DeliveryRetryLimit int `yaml:"delivery_retry_limit" env:"DELIVERY_RETRY_LIMIT"`
LogRetryLimit int `yaml:"log_retry_limit" env:"LOG_RETRY_LIMIT"`
}
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"`
Logo string `yaml:"logo" env:"PORTAL_LOGO"`
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 ( ServiceTypeSingular ServiceType = iota ServiceTypeAPI ServiceTypeLog ServiceTypeDelivery )
func ServiceTypeFromString ¶
func ServiceTypeFromString(s string) (ServiceType, error)
func (ServiceType) String ¶
func (s ServiceType) String() string
Click to show internal directories.
Click to hide internal directories.