common

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySectionAndProfile

func ApplySectionAndProfile(v *viper.Viper, section, profile string) (*viper.Viper, error)

ApplySectionAndProfile extracts a section (server/agent/edge) and overlays profiles.<name> if present.

func GetLogCounters

func GetLogCounters() map[string]int64

GetLogCounters returns current log counters by level.

func LoadWithIncludes

func LoadWithIncludes(base string, includes []string) (*viper.Viper, error)

LoadWithIncludes reads base config and merges includes in order.

func MergeLogSection

func MergeLogSection(v *viper.Viper)

MergeLogSection flattens a nested "log" section into top-level log.* keys.

func SetupLoggerWithFile

func SetupLoggerWithFile(level, format, filePath string, maxSizeMB, maxBackups, maxAgeDays int, compress bool)

SetupLoggerWithFile configures both std log and slog default logger. format: console|json; level: debug|info|warn|error. If filePath != "", logs write to a rotating file.

func ValidateAddr

func ValidateAddr(addr string) error

func ValidateAgentConfig

func ValidateAgentConfig(v *viper.Viper, strict bool) error

func ValidateServerConfig

func ValidateServerConfig(v *viper.Viper, strict bool) error

func ValidateTLS

func ValidateTLS(cert, key, ca string, strict bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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