parsing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 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 Backend

type Backend struct {
	Url     string `toml:"url"`
	VarName string `toml:"varName"`
}

type Config

type Config struct {
	Core     Core     `toml:"core"`
	LimitReq LimitReq `toml:"limitReq"`
	Proxy    Proxy    `toml:"proxy"`
}

The configuration struct of config.toml

func GetConfig

func GetConfig() *Config

type Core

type Core struct {
	Listen            int  `toml:"listen"`
	ApiPort           int  `toml:"apiport"`
	LimitMaxConn      int  `toml:"limitMaxConn"`
	ReadTimeout       int  `toml:"readTimeout"`
	WriteTimeout      int  `toml:"writeTimeout"`
	IdleTimeout       int  `toml:"idleTimeout"`
	EnableServerStats bool `toml:"enableServerStats"`
}

type File added in v1.0.0

type File struct {
	FilePath string
}
var (
	ConfigFile *File
)

type LimitReq

type LimitReq struct {
	Enable    bool `toml:"enable"`
	Interval  int  `toml:"interval"`
	Frequency int  `toml:"frequency"`
	Mode      int  `toml:"mode"`
}

type Proxy

type Proxy struct {
	Routes []Route `toml:"routes"`
}

type Route

type Route struct {
	Endpoint string    `toml:"endpoint"`
	Match    int       `toml:"match"`
	Balancer int       `toml:"balancer"`
	Backends []Backend `toml:"backends"`
}

Jump to

Keyboard shortcuts

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