loader

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUpstream       = "http://localhost:8080"
	DefaultRuleFile       = "configs/default.rules.hcl"
	DefaultAccessLog      = "events.jsonl"
	DefaultListenBind     = "0.0.0.0:8443"
	DefaultProxyCacheSize = proxy.DefaultProxyCacheSize
)

Built-in defaults used when synthesising configs.

Variables

This section is empty.

Functions

func AbsFromCWD

func AbsFromCWD(p string) (string, error)

AbsFromCWD resolves p against the current working directory when not already absolute and returns a canonical absolute path.

func LoadMain

func LoadMain(path string) (config.Config, error)

LoadMain reads and validates the HCL configuration at path.

func LoadRules

func LoadRules(path string) (*rules.RuleSet, error)

LoadRules loads a rule set from path after resolving it to an absolute path.

func Merge

func Merge(cfg *config.Config, ov Overrides) error

Merge applies CLI overrides to cfg according to precedence rules.

func SynthesiseFromFlags

func SynthesiseFromFlags(cmd *cli.Command) (config.Config, error)

SynthesiseFromFlags builds a config for quick mode from a cli.Command.

Types

type Overrides

type Overrides struct {
	Upstream              string
	UpstreamSet           bool
	RuleFile              string
	RuleFileSet           bool
	AccessLog             string
	AccessLogSet          bool
	ProxyCacheSize        int
	ProxyCacheSizeSet     bool
	DefaultAction         string
	DefaultActionSet      bool
	UpstreamCAFile        string
	UpstreamCAFileSet     bool
	UpstreamSkipTLSVerify bool
	UpstreamSkipSet       bool
	AdminEnabled          bool
	AdminEnabledSet       bool
	AdminAddr             string
	AdminAddrSet          bool
	AdminToken            string
	AdminTokenSet         bool
	SSEEnabled            bool
	SSEEnabledSet         bool
	SSEAddr               string
	SSEAddrSet            bool
}

Overrides contains CLI override values applied when a main config is loaded. Zero-value fields are ignored unless the corresponding Set flag is true.

Jump to

Keyboard shortcuts

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