config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	JWTSecret    string `koanf:"jwt.secret"`
	EnableAuth   bool   `koanf:"enable.auth"`
	RequiredRole string `koanf:"required.role"`
}

AuthConfig holds authentication configuration

type Config

type Config struct {
	Server     ServerConfig     `koanf:"server"`
	OpenSearch OpenSearchConfig `koanf:"opensearch"`
	Prometheus PrometheusConfig `koanf:"prometheus"`
	Auth       AuthConfig       `koanf:"auth"`
	Logging    LoggingConfig    `koanf:"logging"`
	LogLevel   string           `koanf:"loglevel"`
}

Config holds all configuration for the logging service

func Load

func Load() (*Config, error)

Load loads configuration from environment variables and defaults

type LoggingConfig

type LoggingConfig struct {
	MaxLogLimit          int `koanf:"max.log.limit"`
	DefaultLogLimit      int `koanf:"default.log.limit"`
	DefaultBuildLogLimit int `koanf:"default.build.log.limit"`
	MaxLogLinesPerFile   int `koanf:"max.log.lines.per.file"`
}

LoggingConfig holds application logging configuration

type OpenSearchConfig

type OpenSearchConfig struct {
	Address       string        `koanf:"address"`
	Username      string        `koanf:"username"`
	Password      string        `koanf:"password"`
	Timeout       time.Duration `koanf:"timeout"`
	MaxRetries    int           `koanf:"max.retries"`
	IndexPrefix   string        `koanf:"index.prefix"`
	IndexPattern  string        `koanf:"index.pattern"`
	LegacyPattern string        `koanf:"legacy.pattern"`
}

OpenSearchConfig holds OpenSearch connection configuration

type PrometheusConfig added in v0.4.0

type PrometheusConfig struct {
	Address string        `koanf:"address"`
	Timeout time.Duration `koanf:"timeout"`
}

PrometheusConfig holds Prometheus connection configuration

type ServerConfig

type ServerConfig struct {
	Port            int           `koanf:"port"`
	ReadTimeout     time.Duration `koanf:"read.timeout"`
	WriteTimeout    time.Duration `koanf:"write.timeout"`
	ShutdownTimeout time.Duration `koanf:"shutdown.timeout"`
}

ServerConfig holds HTTP server configuration

Jump to

Keyboard shortcuts

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