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) GetRetryBackoff() (backoff.Backoff, int)
- 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 IDGenConfig
- 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") ErrInvalidDeploymentID = errors.New("config validation error: deployment_id must contain only alphanumeric characters, hyphens, and underscores (max 64 characters)") )
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
DeploymentID string `` /* 206-byte string literal not displayed */
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
RetrySchedule []int `` /* 314-byte string literal not displayed */
RetryIntervalSeconds int `` /* 186-byte string literal not displayed */
RetryMaxLimit int `` /* 182-byte string literal not displayed */
// Event Delivery
MaxDestinationsPerTenant int `` /* 152-byte string literal not displayed */
DeliveryTimeoutSeconds int `` /* 171-byte string literal not displayed */
// Idempotency
PublishIdempotencyKeyTTL int `` /* 255-byte string literal not displayed */
DeliveryIdempotencyKeyTTL int `` /* 269-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"`
// ID Generation
IDGen IDGenConfig `yaml:"idgen"`
// 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) GetRetryBackoff ¶ added in v0.8.0
GetRetryBackoff returns the configured backoff strategy based on retry configuration
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 {
// ProxyURL may contain authentication credentials (e.g., http://user:pass@proxy:8080)
// and should be treated as sensitive.
// TODO: Implement sensitive value handling - https://github.com/hookdeck/outpost/issues/480
Mode string `` /* 198-byte string literal not displayed */
ProxyURL string `` /* 259-byte string literal not displayed */
HeaderPrefix string `` /* 214-byte string literal not displayed */
DisableDefaultEventIDHeader bool `` /* 235-byte string literal not displayed */
DisableDefaultSignatureHeader bool `` /* 238-byte string literal not displayed */
DisableDefaultTimestampHeader bool `` /* 238-byte string literal not displayed */
DisableDefaultTopicHeader bool `` /* 226-byte string literal not displayed */
SignatureContentTemplate string `` /* 215-byte string literal not displayed */
SignatureHeaderTemplate string `` /* 188-byte string literal not displayed */
SignatureEncoding string `` /* 175-byte string literal not displayed */
SignatureAlgorithm string `` /* 192-byte string literal not displayed */
}
Webhook configuration
type DestinationsConfig ¶
type DestinationsConfig struct {
MetadataPath string `` /* 225-byte string literal not displayed */
IncludeMillisecondTimestamp bool `` /* 237-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 IDGenConfig ¶ added in v0.8.0
type IDGenConfig struct {
Type string `yaml:"type" env:"IDGEN_TYPE" desc:"ID generation type for all entities: uuidv4, uuidv7, nanoid. Default: uuidv4" required:"N"`
EventPrefix string `` /* 158-byte string literal not displayed */
DestinationPrefix string `` /* 176-byte string literal not displayed */
DeliveryPrefix string `` /* 167-byte string literal not displayed */
DeliveryEventPrefix string `` /* 185-byte string literal not displayed */
}
IDGenConfig is the configuration for ID generation
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 `` /* 132-byte string literal not displayed */
TLSEnabled bool `yaml:"tls_enabled" env:"REDIS_TLS_ENABLED" desc:"Enable TLS encryption for Redis connection." required:"N"`
ClusterEnabled bool `` /* 131-byte string literal not displayed */
DevClusterHostOverride bool `` /* 191-byte string literal not displayed */
}
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.