config

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfigPath

func GetDefaultConfigPath() string

GetDefaultConfigPath returns the default path for the config file

func SaveConfig

func SaveConfig(config *Config, configPath string) error

SaveConfig saves the configuration to the specified file

Types

type Config

type Config struct {
	ActiveProfile string             `json:"active_profile"`
	Profiles      map[string]Profile `json:"profiles"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig creates a new configuration with default values

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads the configuration from the specified file

func (*Config) GetActiveProfile

func (c *Config) GetActiveProfile() Profile

GetActiveProfile returns the active profile from the configuration

type Profile

type Profile struct {
	Format           string            `json:"format"`
	Fields           []string          `json:"fields"`
	MaxDepth         int               `json:"max_depth"`
	HideMissing      bool              `json:"hide_missing"`
	Filters          []string          `json:"filters"`
	Excludes         []string          `json:"excludes"`
	LevelMappings    map[string]string `json:"level_mappings"`
	AutoConvertLevel bool              `json:"auto_convert_level"`
	TimeFormat       string            `json:"time_format"`
}

Profile represents a single configuration profile

Jump to

Keyboard shortcuts

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