Documentation
¶
Index ¶
- type APIKeyConfig
- type APIKeyDetails
- type AuthConfig
- type BillingConfig
- type BucketConfig
- type CacheConfig
- type ClickHouseConfig
- type Configuration
- type DeploymentConfig
- type DynamoDBConfig
- type EnvAccessConfig
- type EventConfig
- type EventPostProcessingConfig
- type KafkaConfig
- type LoggingConfig
- type PostgresConfig
- type S3Config
- type SecretsConfig
- type SentryConfig
- type ServerConfig
- type SupabaseConfig
- type Svix
- type TemporalConfig
- type TenantWebhookConfig
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyConfig ¶
type APIKeyConfig struct {
Header string `mapstructure:"header" validate:"required" default:"x-api-key"`
Keys map[string]APIKeyDetails `mapstructure:"keys"` // map of hashed API key to its details
}
type APIKeyDetails ¶
type APIKeyDetails struct {
TenantID string `mapstructure:"tenant_id" json:"tenant_id" validate:"required"`
UserID string `mapstructure:"user_id" json:"user_id" validate:"required"`
Name string `mapstructure:"name" json:"name" validate:"required"` // description of what this key is for
IsActive bool `mapstructure:"is_active" json:"is_active" default:"true"` // whether this key is active
}
type AuthConfig ¶
type AuthConfig struct {
Provider types.AuthProvider `mapstructure:"provider" validate:"required"`
Secret string `mapstructure:"secret" validate:"required"`
Supabase SupabaseConfig `mapstructure:"supabase"`
APIKey APIKeyConfig `mapstructure:"api_key"`
}
type BillingConfig ¶ added in v1.0.0
type BucketConfig ¶ added in v1.0.13
type CacheConfig ¶ added in v1.0.17
type CacheConfig struct {
Enabled bool `mapstructure:"enabled" validate:"required"`
}
type ClickHouseConfig ¶
type ClickHouseConfig struct {
Address string `mapstructure:"address" validate:"required"`
TLS bool `mapstructure:"tls"`
Username string `mapstructure:"username" validate:"required"`
Password string `mapstructure:"password" validate:"required"`
Database string `mapstructure:"database" validate:"required"`
}
func (ClickHouseConfig) GetClientOptions ¶
func (c ClickHouseConfig) GetClientOptions() *clickhouse.Options
type Configuration ¶
type Configuration struct {
Deployment DeploymentConfig `validate:"required"`
Server ServerConfig `validate:"required"`
Auth AuthConfig `validate:"required"`
Kafka KafkaConfig `validate:"required"`
ClickHouse ClickHouseConfig `validate:"required"`
Logging LoggingConfig `validate:"required"`
Postgres PostgresConfig `validate:"required"`
Sentry SentryConfig `validate:"required"`
Event EventConfig `validate:"required"`
DynamoDB DynamoDBConfig `validate:"required"`
Temporal TemporalConfig `validate:"required"`
Webhook Webhook `validate:"omitempty"`
Secrets SecretsConfig `validate:"required"`
Billing BillingConfig `validate:"omitempty"`
S3 S3Config `validate:"required"`
Cache CacheConfig `validate:"required"`
EventPostProcessing EventPostProcessingConfig `mapstructure:"event_post_processing" validate:"required"`
EnvAccess EnvAccessConfig `mapstructure:"env_access" json:"env_access" validate:"omitempty"`
}
func GetDefaultConfig ¶
func GetDefaultConfig() *Configuration
GetDefaultConfig returns a default configuration for local development This is useful for running scripts or other non-web applications
func NewConfig ¶
func NewConfig() (*Configuration, error)
func (Configuration) Validate ¶
func (c Configuration) Validate() error
type DeploymentConfig ¶
type DynamoDBConfig ¶
type DynamoDBConfig struct {
InUse bool `mapstructure:"in_use" validate:"required" default:"false"`
Region string `mapstructure:"region"`
EventTableName string `mapstructure:"event_table_name"`
}
DynamoDBConfig holds configuration for DynamoDB
type EnvAccessConfig ¶ added in v1.0.18
type EventConfig ¶
type EventConfig struct {
PublishDestination types.PublishDestination `mapstructure:"publish_destination" default:"kafka"`
}
EventConfig holds configuration for event processing
type EventPostProcessingConfig ¶ added in v1.0.17
type EventPostProcessingConfig struct {
// Rate limit in messages consumed per second
Topic string `mapstructure:"topic" default:"events_post_processing"`
RateLimit int64 `mapstructure:"rate_limit" default:"1"`
ConsumerGroup string `mapstructure:"consumer_group" default:"v1_events_post_processing"`
TopicBackfill string `mapstructure:"topic_backfill" default:"v1_events_post_processing_backfill"`
RateLimitBackfill int64 `mapstructure:"rate_limit_backfill" default:"1"`
ConsumerGroupBackfill string `mapstructure:"consumer_group_backfill" default:"v1_events_post_processing_backfill"`
}
type KafkaConfig ¶
type KafkaConfig struct {
Brokers []string `mapstructure:"brokers" validate:"required"`
ConsumerGroup string `mapstructure:"consumer_group" validate:"required"`
Topic string `mapstructure:"topic" validate:"required"`
TLS bool `mapstructure:"tls"` // set to true if using 9094 port else can set to false
UseSASL bool `mapstructure:"use_sasl"`
SASLMechanism sarama.SASLMechanism `mapstructure:"sasl_mechanism"`
SASLUser string `mapstructure:"sasl_user"`
SASLPassword string `mapstructure:"sasl_password"`
ClientID string `mapstructure:"client_id" validate:"required"`
}
type LoggingConfig ¶
type PostgresConfig ¶
type PostgresConfig struct {
Host string `mapstructure:"host" validate:"required"`
Port int `mapstructure:"port" validate:"required"`
User string `mapstructure:"user" validate:"required"`
Password string `mapstructure:"password" validate:"required"`
DBName string `mapstructure:"dbname" validate:"required"`
SSLMode string `mapstructure:"sslmode" validate:"required"`
MaxOpenConns int `mapstructure:"max_open_conns" default:"10"`
MaxIdleConns int `mapstructure:"max_idle_conns" default:"5"`
ConnMaxLifetimeMinutes int `mapstructure:"conn_max_lifetime_minutes" default:"60"`
AutoMigrate bool `mapstructure:"auto_migrate" default:"false"`
}
func (PostgresConfig) GetDSN ¶
func (c PostgresConfig) GetDSN() string
type S3Config ¶ added in v1.0.13
type S3Config struct {
Enabled bool `mapstructure:"enabled" validate:"required"`
Region string `mapstructure:"region" validate:"required"`
InvoiceBucketConfig BucketConfig `mapstructure:"invoice" validate:"required"`
}
type SecretsConfig ¶
type SecretsConfig struct {
EncryptionKey string `mapstructure:"encryption_key" validate:"required"`
}
type SentryConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Address string `mapstructure:"address" validate:"required"`
}
type SupabaseConfig ¶
type TemporalConfig ¶
type TemporalConfig struct {
Address string `mapstructure:"address" validate:"required"`
TaskQueue string `mapstructure:"task_queue" validate:"required"`
Namespace string `mapstructure:"namespace" validate:"required"`
APIKey string `mapstructure:"api_key"`
APIKeyName string `mapstructure:"api_key_name"`
TLS bool `mapstructure:"tls"`
}
type TenantWebhookConfig ¶
type TenantWebhookConfig struct {
Endpoint string `mapstructure:"endpoint"`
Headers map[string]string `mapstructure:"headers"`
Enabled bool `mapstructure:"enabled"`
ExcludedEvents []string `mapstructure:"excluded_events"`
}
TenantWebhookConfig represents webhook configuration for a specific tenant
type Webhook ¶
type Webhook struct {
Enabled bool `mapstructure:"enabled"`
Topic string `mapstructure:"topic" default:"webhooks"`
PubSub types.PubSubType `mapstructure:"pubsub" default:"kafka"`
ConsumerGroup string `mapstructure:"consumer_group" default:"webhook-consumer"`
MaxRetries int `mapstructure:"max_retries" default:"3"`
InitialInterval time.Duration `mapstructure:"initial_interval" default:"1s"`
MaxInterval time.Duration `mapstructure:"max_interval" default:"10s"`
Multiplier float64 `mapstructure:"multiplier" default:"2.0"`
MaxElapsedTime time.Duration `mapstructure:"max_elapsed_time" default:"2m"`
Tenants map[string]TenantWebhookConfig `mapstructure:"tenants"`
Svix Svix `mapstructure:"svix_config"`
}
Webhook represents the configuration for the webhook system
Click to show internal directories.
Click to hide internal directories.