Documentation
¶
Index ¶
- Constants
- Variables
- type AWSSQSConfig
- type AlertConfig
- type AzureServiceBusConfig
- func (c *AzureServiceBusConfig) GetProviderType() string
- func (c *AzureServiceBusConfig) IsConfigured() bool
- func (c *AzureServiceBusConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
- func (c *AzureServiceBusConfig) ToQueueConfig(ctx context.Context, queueType string) (*mqs.QueueConfig, error)
- 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 DestinationAWSKinesisConfig
- type DestinationWebhookConfig
- type DestinationsConfig
- type Flags
- type GCPPubSubConfig
- type MQConfigAdapter
- type MQsConfig
- type OSInterface
- type OpenTelemetryConfig
- type OpenTelemetryTypeConfig
- type PortalConfig
- type PublishAWSSQSConfig
- type PublishAzureServiceBusConfig
- type PublishGCPPubSubConfig
- 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 `` /* 142-byte string literal not displayed */ SecretAccessKey string `` /* 154-byte string literal not displayed */ Region string `yaml:"region" env:"AWS_SQS_REGION" desc:"AWS Region for SQS. Required if AWS SQS is the chosen MQ provider." required:"C"` Endpoint string `` /* 150-byte string literal not displayed */ DeliveryQueue string `yaml:"delivery_queue" env:"AWS_SQS_DELIVERY_QUEUE" desc:"Name of the SQS queue for delivery events." required:"N"` LogQueue string `yaml:"log_queue" env:"AWS_SQS_LOG_QUEUE" desc:"Name of the SQS queue for log events." required:"N"` }
func (*AWSSQSConfig) GetProviderType ¶ added in v0.3.0
func (c *AWSSQSConfig) GetProviderType() string
func (*AWSSQSConfig) IsConfigured ¶ added in v0.3.0
func (c *AWSSQSConfig) IsConfigured() bool
func (*AWSSQSConfig) ToInfraConfig ¶ added in v0.3.0
func (c *AWSSQSConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
func (*AWSSQSConfig) ToQueueConfig ¶ added in v0.3.0
func (c *AWSSQSConfig) ToQueueConfig(ctx context.Context, queueType string) (*mqs.QueueConfig, error)
type AlertConfig ¶
type AzureServiceBusConfig ¶ added in v0.3.0
type AzureServiceBusConfig struct { // Using AzureSB with ConnectionString will skip infra management ConnectionString string `yaml:"connection_string" env:"AZURE_SERVICEBUS_CONNECTION_STRING" desc:"Azure Service Bus connection string" required:"N"` TenantID string `yaml:"tenant_id" env:"AZURE_SERVICEBUS_TENANT_ID" desc:"Azure Active Directory tenant ID" required:"Y"` ClientID string `yaml:"client_id" env:"AZURE_SERVICEBUS_CLIENT_ID" desc:"Service principal client ID" required:"Y"` ClientSecret string `yaml:"client_secret" env:"AZURE_SERVICEBUS_CLIENT_SECRET" desc:"Service principal client secret" required:"Y"` SubscriptionID string `yaml:"subscription_id" env:"AZURE_SERVICEBUS_SUBSCRIPTION_ID" desc:"Azure subscription ID" required:"Y"` ResourceGroup string `yaml:"resource_group" env:"AZURE_SERVICEBUS_RESOURCE_GROUP" desc:"Azure resource group name" required:"Y"` Namespace string `yaml:"namespace" env:"AZURE_SERVICEBUS_NAMESPACE" desc:"Azure Service Bus namespace" required:"Y"` DeliveryTopic string `` /* 136-byte string literal not displayed */ DeliverySubscription string `` /* 161-byte string literal not displayed */ LogTopic string `yaml:"log_topic" env:"AZURE_SERVICEBUS_LOG_TOPIC" desc:"Topic name for log queue" required:"N" default:"outpost-log"` LogSubscription string `` /* 141-byte string literal not displayed */ }
func (*AzureServiceBusConfig) GetProviderType ¶ added in v0.3.0
func (c *AzureServiceBusConfig) GetProviderType() string
func (*AzureServiceBusConfig) IsConfigured ¶ added in v0.3.0
func (c *AzureServiceBusConfig) IsConfigured() bool
func (*AzureServiceBusConfig) ToInfraConfig ¶ added in v0.3.0
func (c *AzureServiceBusConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
func (*AzureServiceBusConfig) ToQueueConfig ¶ added in v0.3.0
func (c *AzureServiceBusConfig) ToQueueConfig(ctx context.Context, queueType string) (*mqs.QueueConfig, error)
type Config ¶
type Config struct { Service string `` /* 175-byte string literal not displayed */ LogLevel string `` /* 153-byte string literal not displayed */ AuditLog bool `yaml:"audit_log" env:"AUDIT_LOG" desc:"Enables or disables audit logging for significant events." required:"N"` OpenTelemetry OpenTelemetryConfig `yaml:"otel"` Telemetry TelemetryConfig `yaml:"telemetry"` // API APIPort int `yaml:"api_port" env:"API_PORT" desc:"Port number for the API server to listen on." required:"N"` APIKey string `yaml:"api_key" env:"API_KEY" desc:"API key for authenticating requests to the Outpost API." required:"Y"` APIJWTSecret string `` /* 147-byte string literal not displayed */ GinMode string `` /* 149-byte string literal not displayed */ // Application AESEncryptionSecret string `` /* 159-byte string literal not displayed */ Topics []string `` /* 163-byte string literal not displayed */ OrganizationName string `` /* 159-byte string literal not displayed */ HTTPUserAgent string `` /* 183-byte string literal not displayed */ // Infrastructure Redis RedisConfig `yaml:"redis"` // ClickHouse ClickHouseConfig `yaml:"clickhouse"` PostgresURL string `` /* 173-byte string literal not displayed */ MQs *MQsConfig `yaml:"mqs"` // PublishMQ PublishMQ PublishMQConfig `yaml:"publishmq"` // Consumers PublishMaxConcurrency int `` /* 155-byte string literal not displayed */ DeliveryMaxConcurrency int `` /* 143-byte string literal not displayed */ LogMaxConcurrency int `` /* 138-byte string literal not displayed */ // Delivery Retry RetryIntervalSeconds int `` /* 151-byte string literal not displayed */ RetryMaxLimit int `` /* 143-byte string literal not displayed */ // Event Delivery MaxDestinationsPerTenant int `` /* 152-byte string literal not displayed */ DeliveryTimeoutSeconds int `` /* 171-byte string literal not displayed */ // Destination Registry DestinationMetadataPath string `` /* 201-byte string literal not displayed */ // Log batcher configuration LogBatchThresholdSeconds int `` /* 190-byte string literal not displayed */ LogBatchSize int `` /* 137-byte string literal not displayed */ DisableTelemetry bool `` /* 218-byte string literal not displayed */ // 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 DestinationAWSKinesisConfig ¶
type DestinationAWSKinesisConfig struct {
MetadataInPayload bool `` /* 191-byte string literal not displayed */
}
AWS Kinesis configuration
type DestinationWebhookConfig ¶
type DestinationWebhookConfig struct { HeaderPrefix string `` /* 153-byte string literal not displayed */ DisableDefaultEventIDHeader bool `` /* 203-byte string literal not displayed */ DisableDefaultSignatureHeader bool `` /* 206-byte string literal not displayed */ DisableDefaultTimestampHeader bool `` /* 206-byte string literal not displayed */ DisableDefaultTopicHeader bool `` /* 194-byte string literal not displayed */ SignatureContentTemplate string `` /* 183-byte string literal not displayed */ SignatureHeaderTemplate string `` /* 156-byte string literal not displayed */ SignatureEncoding string `` /* 143-byte string literal not displayed */ SignatureAlgorithm string `` /* 160-byte string literal not displayed */ }
Webhook configuration
type DestinationsConfig ¶
type DestinationsConfig struct { MetadataPath string `` /* 225-byte string literal not displayed */ Webhook DestinationWebhookConfig `yaml:"webhook" desc:"Configuration specific to webhook destinations."` AWSKinesis DestinationAWSKinesisConfig `yaml:"aws_kinesis" desc:"Configuration specific to AWS Kinesis destinations."` }
DestinationsConfig is the main configuration for all destination types
func (*DestinationsConfig) ToConfig ¶
func (c *DestinationsConfig) ToConfig(cfg *Config) 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 GCPPubSubConfig ¶
type GCPPubSubConfig struct { Project string `` /* 138-byte string literal not displayed */ ServiceAccountCredentials string `` /* 313-byte string literal not displayed */ DeliveryTopic string `yaml:"delivery_topic" env:"GCP_PUBSUB_DELIVERY_TOPIC" desc:"Name of the GCP Pub/Sub topic for delivery events." required:"N"` DeliverySubscription string `` /* 145-byte string literal not displayed */ LogTopic string `yaml:"log_topic" env:"GCP_PUBSUB_LOG_TOPIC" desc:"Name of the GCP Pub/Sub topic for log events." required:"N"` LogSubscription string `` /* 130-byte string literal not displayed */ }
func (*GCPPubSubConfig) GetProviderType ¶ added in v0.3.0
func (c *GCPPubSubConfig) GetProviderType() string
func (*GCPPubSubConfig) IsConfigured ¶ added in v0.3.0
func (c *GCPPubSubConfig) IsConfigured() bool
func (*GCPPubSubConfig) ToInfraConfig ¶ added in v0.3.0
func (c *GCPPubSubConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
func (*GCPPubSubConfig) ToQueueConfig ¶ added in v0.3.0
func (c *GCPPubSubConfig) ToQueueConfig(ctx context.Context, queueType string) (*mqs.QueueConfig, error)
type MQConfigAdapter ¶ added in v0.3.0
type MQsConfig ¶
type MQsConfig struct { AWSSQS AWSSQSConfig `` /* 131-byte string literal not displayed */ AzureServiceBus AzureServiceBusConfig `` /* 150-byte string literal not displayed */ GCPPubSub GCPPubSubConfig `` /* 138-byte string literal not displayed */ RabbitMQ RabbitMQConfig `` /* 133-byte string literal not displayed */ // contains filtered or unexported fields }
func (*MQsConfig) GetInfraType ¶
func (*MQsConfig) ToInfraConfig ¶ added in v0.3.0
func (c *MQsConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
func (*MQsConfig) ToQueueConfig ¶ added in v0.3.0
type OSInterface ¶
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct { ServiceName string `` /* 146-byte string literal not displayed */ Traces OpenTelemetryTypeConfig `yaml:"traces" desc:"OpenTelemetry configuration specific to traces."` Metrics OpenTelemetryTypeConfig `yaml:"metrics" desc:"OpenTelemetry configuration specific to metrics."` Logs OpenTelemetryTypeConfig `yaml:"logs" desc:"OpenTelemetry configuration specific to 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 `` /* 197-byte string literal not displayed */ RefererURL string `` /* 228-byte string literal not displayed */ FaviconURL string `yaml:"favicon_url" env:"PORTAL_FAVICON_URL" desc:"URL for the favicon to be used in the Outpost Portal." required:"N"` BrandColor string `` /* 195-byte string literal not displayed */ Logo string `yaml:"logo" env:"PORTAL_LOGO" desc:"URL for the light-mode logo to be displayed in the Outpost Portal." required:"N"` LogoDark string `yaml:"logo_dark" env:"PORTAL_LOGO_DARK" desc:"URL for the dark-mode logo to be displayed in the Outpost Portal." required:"N"` OrgName string `yaml:"org_name" env:"PORTAL_ORGANIZATION_NAME" desc:"Organization name displayed in the Outpost Portal." required:"N"` ForceTheme string `` /* 134-byte string literal not displayed */ DisableOutpostBranding bool `` /* 139-byte string literal not displayed */ }
type PublishAWSSQSConfig ¶
type PublishAWSSQSConfig struct { AccessKeyID string `` /* 176-byte string literal not displayed */ SecretAccessKey string `` /* 188-byte string literal not displayed */ Region string `` /* 155-byte string literal not displayed */ Endpoint string `` /* 127-byte string literal not displayed */ Queue string `` /* 160-byte string literal not displayed */ }
type PublishAzureServiceBusConfig ¶ added in v0.4.0
type PublishGCPPubSubConfig ¶
type PublishGCPPubSubConfig struct { Project string `` /* 172-byte string literal not displayed */ Topic string `` /* 175-byte string literal not displayed */ Subscription string `` /* 204-byte string literal not displayed */ ServiceAccountCredentials string `` /* 281-byte string literal not displayed */ }
type PublishMQConfig ¶
type PublishMQConfig struct { AWSSQS PublishAWSSQSConfig `` /* 147-byte string literal not displayed */ AzureServiceBus PublishAzureServiceBusConfig `` /* 166-byte string literal not displayed */ GCPPubSub PublishGCPPubSubConfig `` /* 154-byte string literal not displayed */ RabbitMQ PublishRabbitMQConfig `` /* 149-byte string literal not displayed */ }
func (PublishMQConfig) GetInfraType ¶
func (c PublishMQConfig) GetInfraType() string
func (*PublishMQConfig) GetQueueConfig ¶
func (c *PublishMQConfig) GetQueueConfig() *mqs.QueueConfig
type PublishRabbitMQConfig ¶
type PublishRabbitMQConfig struct { ServerURL string `` /* 181-byte string literal not displayed */ Exchange string `yaml:"exchange" env:"PUBLISH_RABBITMQ_EXCHANGE" desc:"Name of the RabbitMQ exchange for the publish queue." required:"N"` Queue string `` /* 167-byte string literal not displayed */ }
type RabbitMQConfig ¶
type RabbitMQConfig struct { ServerURL string `` /* 186-byte string literal not displayed */ Exchange string `yaml:"exchange" env:"RABBITMQ_EXCHANGE" desc:"Name of the RabbitMQ exchange to use." required:"N"` DeliveryQueue string `yaml:"delivery_queue" env:"RABBITMQ_DELIVERY_QUEUE" desc:"Name of the RabbitMQ queue for delivery events." required:"N"` LogQueue string `yaml:"log_queue" env:"RABBITMQ_LOG_QUEUE" desc:"Name of the RabbitMQ queue for log events." required:"N"` }
func (*RabbitMQConfig) GetProviderType ¶ added in v0.3.0
func (c *RabbitMQConfig) GetProviderType() string
func (*RabbitMQConfig) IsConfigured ¶ added in v0.3.0
func (c *RabbitMQConfig) IsConfigured() bool
func (*RabbitMQConfig) ToInfraConfig ¶ added in v0.3.0
func (c *RabbitMQConfig) ToInfraConfig(queueType string) *mqinfra.MQInfraConfig
func (*RabbitMQConfig) ToQueueConfig ¶ added in v0.3.0
func (c *RabbitMQConfig) ToQueueConfig(ctx context.Context, queueType string) (*mqs.QueueConfig, error)
type RedisConfig ¶
type RedisConfig struct { Host string `yaml:"host" env:"REDIS_HOST" desc:"Hostname or IP address of the Redis server." required:"Y"` Port int `yaml:"port" env:"REDIS_PORT" desc:"Port number for the Redis server." required:"Y"` Password string `yaml:"password" env:"REDIS_PASSWORD" desc:"Password for Redis authentication, if required by the server." required:"Y"` Database int `yaml:"database" env:"REDIS_DATABASE" desc:"Redis database number to select after connecting." required:"Y"` }
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 `` /* 233-byte string literal not displayed */ BatchSize int `yaml:"batch_size" env:"TELEMETRY_BATCH_SIZE" desc:"Maximum number of telemetry events to batch before sending." required:"N"` BatchInterval int `` /* 177-byte string literal not displayed */ HookdeckSourceURL string `` /* 194-byte string literal not displayed */ SentryDSN string `` /* 175-byte string literal not displayed */ }
func (*TelemetryConfig) ToTelemetryConfig ¶
func (c *TelemetryConfig) ToTelemetryConfig() telemetry.TelemetryConfig
Click to show internal directories.
Click to hide internal directories.