Discover Packages
github.com/benc-uk/nanoproxy
pkg
config
package
Version:
v0.0.0-...-03b039a
Opens a new window with list of versions in this module.
Published: Jan 3, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Simple getter for configPath
type Config struct {
Upstreams []Upstream `yaml:"upstreams"`
Rules []Rule `yaml:"rules"`
Filepath string `yaml:"-"`
}
Config is the main configuration for the proxy
Load reads the configuration file and returns the configuration.
It returns an error if the configuration file cannot be loaded.
Dump the config to a string
Write the config to the config file
type Rule struct {
Path string `yaml:"path"`
Upstream string `yaml:"upstream"`
MatchMode string `yaml:"matchMode"`
Host string `yaml:"host"`
StripPath bool `yaml:"stripPath"`
}
Rule sets host and/or path to match and the upstream to use
type Upstream struct {
Name string `yaml:"name"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Scheme string `yaml:"scheme"`
NoHostRewrite bool `yaml:"noHostRewrite"`
}
Upstream is a backend server
Source Files
¶
Click to show internal directories.
Click to hide internal directories.