Documentation
¶
Index ¶
- func ValidateConfig(c *Config) error
- type Config
- func (c *Config) GetAWSAccessKeyID() string
- func (c *Config) GetAWSAccountID() string
- func (c *Config) GetAWSEndpoint() string
- func (c *Config) GetAWSRegion() string
- func (c *Config) GetAWSSecretAccessKey() string
- func (c *Config) GetHTTPPublisherURL() string
- func (c *Config) GetHTTPServerAddress() string
- func (c *Config) GetIOFile() string
- func (c *Config) GetKafkaBrokers() []string
- func (c *Config) GetKafkaConsumerGroup() string
- func (c *Config) GetNATSURL() string
- func (c *Config) GetPostgresURL() string
- func (c *Config) GetPubSubSystem() string
- func (c *Config) GetRabbitMQURL() string
- func (c *Config) GetSQLiteFile() string
- func (c Config) String() string
- func (c *Config) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶ added in v0.4.1
ValidateConfig is a convenience function to validate a config pointer. Returns nil if the config is valid.
Types ¶
type Config ¶
type Config struct {
// PubSubSystem selects the backing message infrastructure. Supported values:
// "kafka", "rabbitmq", or "aws" (SNS/SQS).
PubSubSystem string
// Kafka configuration.
KafkaBrokers []string
KafkaClientID string
KafkaConsumerGroup string
// RabbitMQ configuration.
RabbitMQURL string
// NATS configuration.
NATSURL string
// HTTP configuration.
HTTPServerAddress string
// HTTPPublisherURL is the base URL where messages will be sent.
HTTPPublisherURL string
// I/O configuration.
// IOFile is the path to the file used for persistence.
IOFile string
// SQLite configuration.
// SQLiteFile is the path to the SQLite database file.
// Use ":memory:" for an in-memory database (useful for testing).
SQLiteFile string
// PostgreSQL configuration.
// PostgresURL is the PostgreSQL connection string.
// Example: "postgres://user:password@localhost:5432/dbname?sslmode=disable"
PostgresURL string
// PoisonQueue receives messages that cannot be processed even after retries.
PoisonQueue string
// AWS (SNS/SQS) configuration.
AWSRegion string
AWSAccountID string
AWSAccessKeyID string
AWSSecretAccessKey string
// AWSEndpoint optionally points to a custom endpoint (for example, LocalStack
// in local development).
AWSEndpoint string
// RetryMiddleware tuning. Zero values fall back to library defaults.
RetryMaxRetries int
RetryInitialInterval time.Duration
RetryMaxInterval time.Duration
// Metrics configuration.
MetricsEnabled bool
// MetricsPort is the port where Prometheus metrics will be exposed.
MetricsPort int
// WebUI configuration.
WebUIEnabled bool
// WebUIPort is the port where the WebUI API will be exposed. Defaults to 8081.
WebUIPort int
// WebUICORSAllowedOrigins specifies allowed origins for CORS. Use "*" for development
// or specific origins like "https://example.com" for production. Empty disables CORS headers.
WebUICORSAllowedOrigins []string
}
Config groups the Pub/Sub settings required to initialise the Service. Each transport only uses the keys that are relevant to it.
func (*Config) GetAWSAccessKeyID ¶ added in v0.4.1
func (*Config) GetAWSAccountID ¶ added in v0.4.1
func (*Config) GetAWSEndpoint ¶ added in v0.4.1
func (*Config) GetAWSRegion ¶ added in v0.4.1
func (*Config) GetAWSSecretAccessKey ¶ added in v0.4.1
func (*Config) GetHTTPPublisherURL ¶ added in v0.4.1
func (*Config) GetHTTPServerAddress ¶ added in v0.4.1
func (*Config) GetKafkaBrokers ¶ added in v0.4.1
func (*Config) GetKafkaConsumerGroup ¶ added in v0.4.1
func (*Config) GetNATSURL ¶ added in v0.4.1
func (*Config) GetPostgresURL ¶ added in v0.4.1
func (*Config) GetPubSubSystem ¶ added in v0.4.1
Getter methods to implement transport.Config interface.
func (*Config) GetRabbitMQURL ¶ added in v0.4.1
func (*Config) GetSQLiteFile ¶ added in v0.4.1
Click to show internal directories.
Click to hide internal directories.