config

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	APIPort           string `env:"PORT,required" envDefault:"12222"`
	APIKey            string `env:"API_KEY,required"`
	RabbitMQURL       string `env:"RABBITMQ_URL"`
	TrackingPublicUrl string `env:"TRACKING_PUBLIC_URL" envDefault:"https://custosmetrics.com"`
	Logger            *logger.Config
	Tracing           *tracing.JaegerConfig
}

type Config

type Config struct {
	AppConfig               *AppConfig
	Logger                  *logger.Config
	Tracing                 *tracing.JaegerConfig
	MailstackDatabaseConfig *MailstackDatabaseConfig
	OpenlineDatabaseConfig  *OpenlineDatabaseConfig
	R2StorageConfig         *R2StorageConfig
}

func InitConfig

func InitConfig() (*Config, error)

type MailstackDatabaseConfig

type MailstackDatabaseConfig struct {
	Host            string `env:"MAILSTACK_POSTGRES_HOST,required"`
	Port            string `env:"MAILSTACK_POSTGRES_PORT,required"`
	User            string `env:"MAILSTACK_POSTGRES_USER,required"`
	DBName          string `env:"MAILSTACK_POSTGRES_DB_NAME,required"`
	Password        string `env:"MAILSTACK_POSTGRES_PASSWORD,required"`
	MaxConn         int    `env:"MAILSTACK_POSTGRES_DB_MAX_CONN"`
	MaxIdleConn     int    `env:"MAILSTACK_POSTGRES_DB_MAX_IDLE_CONN"`
	ConnMaxLifetime int    `env:"MAILSTACK_POSTGRES_DB_CONN_MAX_LIFETIME"`
	LogLevel        string `env:"MAILSTACK_POSTGRES_LOG_LEVEL" envDefault:"WARN"`
	SSLMode         string `env:"MAILSTACK_POSTGRES_SSL_MODE"`
}

type OpenlineDatabaseConfig

type OpenlineDatabaseConfig struct {
	Host            string `env:"OPENLINE_POSTGRES_HOST,required"`
	Port            string `env:"OPENLINE_POSTGRES_PORT,required"`
	User            string `env:"OPENLINE_POSTGRES_USER,required"`
	DBName          string `env:"OPENLINE_POSTGRES_DB_NAME,required"`
	Password        string `env:"OPENLINE_POSTGRES_PASSWORD,required"`
	MaxConn         int    `env:"OPENLINE_POSTGRES_DB_MAX_CONN"`
	MaxIdleConn     int    `env:"OPENLINE_POSTGRES_DB_MAX_IDLE_CONN"`
	ConnMaxLifetime int    `env:"OPENLINE_POSTGRES_DB_CONN_MAX_LIFETIME"`
	LogLevel        string `env:"OPENLINE_POSTGRES_LOG_LEVEL" envDefault:"WARN"`
	SSLMode         string `env:"OPENLINE_POSTGRES_SSL_MODE"`
}

type R2StorageConfig

type R2StorageConfig struct {
	AccountID             string `env:"CLOUDFLARE_R2_ACCOUNT_ID,required"`
	AccessKeyID           string `env:"CLOUDFLARE_R2_ACCESS_KEY_ID,required"`
	AccessKeySecret       string `env:"CLOUDFLARE_R2_ACCESS_KEY_SECRET,required"`
	EmailAttachmentBucket string `env:"BUCKET_NAME_EMAIL_ATTACHMENT" envDefault:"attachments"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL