config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config handles YAML configuration loading, defaults, and persistence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(path string, cfg *Config) error

Save writes the config to a YAML file.

Types

type Config

type Config struct {
	ListenAddress string          `yaml:"listen_address"`
	Policy        PolicyConfig    `yaml:"policy"`
	Logging       LogConfig       `yaml:"logging"`
	Intercept     InterceptConfig `yaml:"intercept"`
}

func Load

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

type InterceptConfig

type InterceptConfig struct {
	CACert           string   `yaml:"ca_cert"`
	CAKey            string   `yaml:"ca_key"`
	LogBody          bool     `yaml:"log_body"`
	MaxBodySize      int      `yaml:"max_body_size"`
	SkipContentTypes []string `yaml:"skip_content_types"`
}

type LogConfig

type LogConfig struct {
	Format    string `yaml:"format"`
	File      string `yaml:"file"`
	MaxSizeMB int    `yaml:"max_size_mb"`
}

type PolicyConfig

type PolicyConfig struct {
	DenyFilePatterns    []string `yaml:"deny_file_patterns"`
	AllowedDirectories  []string `yaml:"allowed_directories"`
	DenyContentTags     []string `yaml:"deny_content_tags"`
	DenyContentKeywords []string `yaml:"deny_content_keywords"`
	ContentWhitelist    []string `yaml:"content_whitelist"`
	ContentBlacklist    []string `yaml:"content_blacklist"`
}

Jump to

Keyboard shortcuts

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