config

package
v0.0.0-...-aa1834b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: BSD-3-Clause Imports: 13 Imported by: 57

Documentation

Index

Constants

View Source
const DefaultQueueSize = 512

Variables

View Source
var (
	Debug         bool
	Addr          string
	InternalIPNet []net.IPNet
)

Functions

func Context

func Context(ctx context.Context, conf ini.File, service string) context.Context

func ForContext

func ForContext(ctx context.Context) ini.File

func GetInt

func GetInt(conf ini.File, section, name string, defValue int) int

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 GetOrigin

func GetOrigin(conf ini.File, svc string, external bool) string

func IsInternalIP

func IsInternalIP(ip net.IP) bool

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 LoadFiles

func LoadFiles() ini.File

Just loads the config files

func Middleware

func Middleware(conf ini.File, service string) func(next http.Handler) http.Handler

func ServiceName

func ServiceName(ctx context.Context) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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