internal

package
v0.0.0-...-d0a7eda Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCaches

func InitCaches() error

InitCaches does an initial fetch of all Zones and PAC Files this differs from the automated lookup in that it also errors out when minor problems are found

func InitEventLogger

func InitEventLogger()

func LaunchServer

func LaunchServer()

func LoadConfig

func LoadConfig(filename string) error

func ReadPidFile

func ReadPidFile() (int, error)

ReadPidFile reads the process ID from the configured PID file

func RemovePidFile

func RemovePidFile() error

RemovePidFile removes the PID file if it exists

func WritePidFile

func WritePidFile() error

WritePidFile writes the current process ID to the configured PID file

Types

type Config

type Config struct {
	IPMapFile         string
	PACRoot           string
	DefaultPACFile    string
	WPADFile          string
	ContactInfo       string
	AccessLogFile     string
	EventLogFile      string
	MaxCacheAge       int64
	PidFile           string
	Port              uint16
	PrometheusEnabled bool
	PrometheusPath    string
	IgnoreMinors      bool
	Loglevel          string
}

func GetConfig

func GetConfig() *Config

type LookupElement

type LookupElement struct {
	IPMap *ipMap       `json:"IPMap"`
	PAC   *pacTemplate `json:"PAC"`
	// the parsed content of the PAC Template
	Variant string
}

func NewLookupElement

func NewLookupElement(ipMap *ipMap, pac *pacTemplate, contactInfo string) (LookupElement, error)

type YAMLConfig

type YAMLConfig struct {
	// YAML unfortunately doesn't support default values
	// we can, however, use pointers to identify if a value is not set
	IPMapFile         *string `yaml:"ipMapFile"`
	PACRoot           *string `yaml:"pacRoot"`
	DefaultPACFile    *string `yaml:"defaultPACFile"`
	WPADFile          *string `yaml:"wpadFile"`
	ContactInfo       *string `yaml:"contactInfo"`
	AccessLogFile     *string `yaml:"accessLogFile"`
	EventLogFile      *string `yaml:"eventLogFile"`
	MaxCacheAge       *int64  `yaml:"maxCacheAge"`
	PidFile           *string `yaml:"pidFile"`
	Port              *uint16 `yaml:"port"`
	PrometheusEnabled *bool   `yaml:"prometheusEnabled"`
	PrometheusPath    *string `yaml:"prometheusPath"`
	IgnoreMinors      *bool   `yaml:"ignoreMinors"`
	Loglevel          *string `yaml:"loglevel"`
}

Jump to

Keyboard shortcuts

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