config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 7 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 config file path.

Types

type Config

type Config struct {
	GitHub    GitHubConfig    `yaml:"github"`
	Reconcile ReconcileConfig `yaml:"reconcile"`
	Log       LogConfig       `yaml:"log"`
	WebAPI    WebAPIConfig    `yaml:"webapi"`
}

Config represents the entire application configuration.

func Load

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

Load reads and parses the config file. If the file does not exist, the application falls back to environment variables and built-in defaults so that a config file is not required.

func (*Config) GetPrivateKey

func (c *Config) GetPrivateKey() ([]byte, error)

GetPrivateKey returns the private key bytes. Priority: GH_APP_PRIVATE_KEY env var > private_key field > private_key_path file.

type GitHubConfig

type GitHubConfig struct {
	AppID          int64  `yaml:"app_id"`
	PrivateKey     string `yaml:"private_key"`
	PrivateKeyPath string `yaml:"private_key_path"`
}

GitHubConfig holds GitHub App credentials.

type LogConfig

type LogConfig struct {
	Level  string `yaml:"level"`
	Format string `yaml:"format"`
}

LogConfig holds logging settings.

func (*LogConfig) SlogLevel

func (lc *LogConfig) SlogLevel() slog.Level

SlogLevel converts the Level string to slog.Level.

type ReconcileConfig

type ReconcileConfig struct {
	IntervalMinutes       int    `yaml:"interval_minutes"`
	DuplicateGuardSeconds int    `yaml:"duplicate_guard_seconds"`
	DryRun                bool   `yaml:"dry_run"`
	Timezone              string `yaml:"timezone"`
}

ReconcileConfig holds reconciliation loop settings.

type WebAPIConfig

type WebAPIConfig struct {
	Enabled bool   `yaml:"enabled"`
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
}

WebAPIConfig holds web API server settings.

Jump to

Keyboard shortcuts

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