config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPConfig

type AMQPConfig struct {
	BrokerURL              string   `mapstructure:"broker_url" env:"AMQP_BROKER_URL"`
	AllowedVhosts          []string `mapstructure:"allowed_vhosts" env:"AMQP_ALLOWED_VHOSTS"`
	Exchange               string   `mapstructure:"exchange" env:"AMQP_EXCHANGE"`
	Queue                  string   `mapstructure:"queue" env:"AMQP_QUEUE"`
	RoutingKey             string   `mapstructure:"routing_key" env:"AMQP_ROUTING_KEY"`
	OutputTopics           []string `mapstructure:"output_topics" env:"AMQP_OUTPUT_TOPICS"`
	EntityBridgeRoutingKey string   `mapstructure:"entity_bridge_routing_key" env:"AMQP_ENTITY_BRIDGE_ROUTING_KEY"`
	ConsumerTag            string   `mapstructure:"consumer_tag" env:"AMQP_CONSUMER_TAG"`
	PrefetchCount          int      `mapstructure:"prefetch_count" env:"AMQP_PREFETCH_COUNT"`
	AutoAck                bool     `mapstructure:"auto_ack" env:"AMQP_AUTO_ACK"`
}

type Config

type Config struct {
	Server        ServerConfig        `mapstructure:"server"`
	AMQP          AMQPConfig          `mapstructure:"amqp"`
	OrgEvents     OrgEventsConfig     `mapstructure:"org_events"`
	RawDataLog    RawDataLogConfig    `mapstructure:"raw_data_log"`
	OpenTelemetry OpenTelemetryConfig `mapstructure:"opentelemetry"`
}

func New

func New() (Config, error)

type OpenTelemetryConfig

type OpenTelemetryConfig struct {
	Enabled       bool    `mapstructure:"enabled" env:"OTEL_ENABLED"`
	Endpoint      string  `mapstructure:"endpoint" env:"OTEL_EXPORTER_OTLP_ENDPOINT"`
	Environment   string  `mapstructure:"environment" env:"OTEL_ENVIRONMENT"`
	SamplingRatio float64 `mapstructure:"sampling_ratio" env:"OTEL_TRACES_SAMPLER_ARG"`
}

type OrgEventsConfig

type OrgEventsConfig struct {
	Exchange    string `mapstructure:"exchange" env:"ORG_EVENTS_EXCHANGE"`
	Queue       string `mapstructure:"queue" env:"ORG_EVENTS_QUEUE"`
	RoutingKey  string `mapstructure:"routing_key" env:"ORG_EVENTS_ROUTING_KEY"`
	ConsumerTag string `mapstructure:"consumer_tag" env:"ORG_EVENTS_CONSUMER_TAG"`
}

type RawDataLogConfig

type RawDataLogConfig struct {
	LogDir        string `mapstructure:"log_dir" env:"RAW_DATA_LOG_DIR"`
	EnableFileLog bool   `mapstructure:"enable_file_log" env:"RAW_DATA_ENABLE_FILE_LOG"`
	EnableJSONLog bool   `mapstructure:"enable_json_log" env:"RAW_DATA_ENABLE_JSON_LOG"`
	MaxFileSize   int64  `mapstructure:"max_file_size" env:"RAW_DATA_MAX_FILE_SIZE"`
}

type ServerConfig

type ServerConfig struct {
	LogLevel string `mapstructure:"log_level" env:"SERVER_LOG_LEVEL"`
}

Jump to

Keyboard shortcuts

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