configuration_types

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFilePath = atomic.NewString("")

Functions

func WriteFile

func WriteFile(config Config) error

Types

type Config

type Config struct {
	Proxy    []map[string]interface{} `json:"proxy"`
	Rule     []RuleCfg                `json:"rule"`
	Selected struct {
		Proxy string `json:"proxy"`
		Rule  string `json:"rule"`
	} `json:"selected"`
	Setting SettingCfg `json:"setting"`
}

func ReadFile

func ReadFile() (*Config, error)

type DnsItem

type DnsItem struct {
	Local  DnsRule `json:"local"`
	Remote DnsRule `json:"remote"`
}

type DnsRule

type DnsRule struct {
	Address  string   `json:"address"`
	Domains  []string `json:"domains"`
	GeoSites []string `json:"geoSites"`
}

type IPRule

type IPRule struct {
	Bypass []string `json:"bypass"`
	Proxy  []string `json:"proxy"`
}

type IpItem

type IpItem struct {
	Name         string `json:"name"`
	DefaultProxy bool   `json:"defaultProxy"`
	GeoIps       IPRule `json:"geoIps"`
	GeoSites     IPRule `json:"geoSites"`
	Subnet       IPRule `json:"subnet"`
}

type LocalServer

type LocalServer struct {
	Http struct {
		Port    int  `json:"port"`
		Enabled bool `json:"enabled"`
	} `json:"http"`
}

type RuleCfg

type RuleCfg struct {
	Id   string  `json:"id"`
	Name string  `json:"name"`
	Dns  DnsItem `json:"dns"`
	Ip   IpItem  `json:"ip"`
}

type SettingCfg

type SettingCfg struct {
	DefaultInterface string      `json:"defaultInterface"`
	TrueProxyServer  string      `json:"trueProxyServer"`
	LocalServer      LocalServer `json:"localServer"`
}

Jump to

Keyboard shortcuts

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