Documentation ¶
Index ¶
- Constants
- Variables
- func Context(ctx context.Context, conf ini.File, service string) context.Context
- func ForContext(ctx context.Context) ini.File
- func GetInt(conf ini.File, section, name string, defValue int) int
- func GetOrigin(conf ini.File, svc string, external bool) string
- func IsInternalIP(ip net.IP) bool
- func LoadConfig(defaultAddr string) ini.File
- func LoadFiles() ini.File
- func Middleware(conf ini.File, service string) func(next http.Handler) http.Handler
- func ServiceName(ctx context.Context) string
Constants ¶
View Source
const DefaultQueueSize = 512
Variables ¶
View Source
var ( Debug bool Addr string InternalIPNet []net.IPNet )
Functions ¶
func ForContext ¶
func GetInt ¶
Returns the configured integer value for the given section and variable name. If nothing is configured, the default value will be returned. If an invalid integer is configured, this function will panic.
func IsInternalIP ¶
Returns true if the given IP address is part of the internal networks as per the configuration of [sr.ht]internal-ipnet.
func LoadConfig ¶
func LoadConfig(defaultAddr string) ini.File
Loads the application configuration, reads options from the command line, and initializes some internals based on these results.
func Middleware ¶
func ServiceName ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.