config

package
v0.0.0-...-fc760f8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalConfig

func MarshalConfig(config ConfigStruct) ([]byte, error)

Types

type ConfigStruct

type ConfigStruct struct {
	SSL                bool     `json:"ssl"`
	Debug              bool     `json:"debug"`
	ExcludedPaths      []string `json:"excludedPaths"`
	Port               string   `json:"port"`
	SSLPort            string   `json:"sslPort"`
	SSLDomain          string   `json:"sslDomain"`
	SSLCertDays        int      `json:"sslCertDays"`
	SSLMail            string   `json:"sslMail"`
	Cors               bool     `json:"cors"`
	RateLimiter        bool     `json:"rateLimiter"`
	Bann               bool     `json:"bann"`
	Metrics            bool     `json:"metric"`
	Prefix             string   `json:"prefix"`
	PemCrt             string   `json:"pemCrt"`
	PemKey             string   `json:"pemKey"`
	SystemWhitelist    []string `json:"systemWhitelist"`
	SystemWhitelistDNS []string `json:"systemWhitelistDNS"`
	Bannlist           []string `json:"bannlist"`
	Rate               Rates    `json:"rate"`
	RateWhitelist      []string `json:"rateWhitelist"`
	CorsAllowOrigins   []string `json:"corsAllowOrigins"`
	CorsAllowMethods   []string `json:"corsAllowMethods"`
	CorsAllowHeaders   []string `json:"corsAllowHeaders"`
	CorsAdvanced       bool     `json:"corsAdvanced"`
	ExportLog          bool     `json:"exportLog"`
	ExportLogPath      string   `json:"exportLogPath"`
	Hostnamecheck      bool     `json:"hostnamecheck"`
	Hostname           string   `json:"hostname"`
	Name               string   `json:"name"`
}

func LoadConfig

func LoadConfig(path string) (*ConfigStruct, error)

LoadConfig lädt die Konfiguration aus einer JSON-Datei.

type Rates

type Rates struct {
	Rate   int           `json:"rate"`
	Window time.Duration `json:"window"`
}

Jump to

Keyboard shortcuts

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