config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Enabled bool `toml:"enabled"`
}

type Config

type Config struct {
	Server      ServerConfig      `toml:"server"`
	Whitelist   WhitelistConfig   `toml:"whitelist"`
	RateLimit   RateLimitConfig   `toml:"rate_limit"`
	Performance PerformanceConfig `toml:"perfomance"`
	Cache       CacheConfig       `toml:"cache"`
}

func LoadConfig

func LoadConfig() (*Config, error)

type PerformanceConfig

type PerformanceConfig struct {
	PerFork     bool `toml:"perfork"`
	Concurrency int  `toml:"concurrency"`
}

type RateLimitConfig

type RateLimitConfig struct {
	LimitBody   int  `toml:"limit_body"`
	Enabled     bool `toml:"enabled"`
	MaxRequests int  `toml:"max_requests"`
	ExpireTime  int  `toml:"expire_time"`
}

type ServerConfig

type ServerConfig struct {
	Host string `toml:"host"`
	Port int    `toml:"port"`
}

type WhitelistConfig

type WhitelistConfig struct {
	WhitelistedIPs []string `toml:"whitelisted_ips"`
	Enabled        bool     `toml:"enabled"`
}

Jump to

Keyboard shortcuts

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