config

package
v0.0.0-...-0f07e46 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dir string) error

Init prepare necessary files

func Juu

func Juu()

Types

type Config

type Config struct {
	General *General
	// DNS          *DNS
	Experimental *Experimental
	Hosts        *trie.Trie
	Rules        []C.Rule
	Users        []auth.AuthUser
	Proxies      map[string]C.Proxy
	Providers    map[string]provider.ProxyProvider
}

Config is clash config manager

func Parse

func Parse(buf []byte) (*Config, error)

Parse config

func ParseRawConfig

func ParseRawConfig(rawCfg *RawConfig) (*Config, error)

type Experimental

type Experimental struct {
	IgnoreResolveFail bool   `yaml:"ignore-resolve-fail"`
	Interface         string `yaml:"interface-name"`
}

Experimental config

type FallbackFilter

type FallbackFilter struct {
	GeoIP  bool         `yaml:"geoip"`
	IPCIDR []*net.IPNet `yaml:"ipcidr"`
}

FallbackFilter config

type General

type General struct {
	Port           int      `json:"port"`
	SocksPort      int      `json:"socks-port"`
	RedirPort      int      `json:"redir-port"`
	Authentication []string `json:"authentication"`
	AllowLan       bool     `json:"allow-lan"`
	BindAddress    string   `json:"bind-address"`
	// Mode               T.TunnelMode `json:"mode"`
	LogLevel           log.LogLevel `json:"log-level"`
	ExternalController string       `json:"-"`
	ExternalUI         string       `json:"-"`
	Secret             string       `json:"-"`
}

General config

type RawConfig

type RawConfig struct {
	Port               int          `yaml:"port"`
	SocksPort          int          `yaml:"socks-port"`
	RedirPort          int          `yaml:"redir-port"`
	Authentication     []string     `yaml:"authentication"`
	AllowLan           bool         `yaml:"allow-lan"`
	BindAddress        string       `yaml:"bind-address"`
	Mode               T.TunnelMode `yaml:"mode"`
	LogLevel           log.LogLevel `yaml:"log-level"`
	ExternalController string       `yaml:"external-controller"`
	ExternalUI         string       `yaml:"external-ui"`
	Secret             string       `yaml:"secret"`

	ProxyProvider map[string]map[string]interface{} `yaml:"proxy-providers"`
	Hosts         map[string]string                 `yaml:"hosts"`
	// DNS           RawDNS                            `yaml:"dns"`
	Experimental Experimental             `yaml:"experimental"`
	Proxy        []map[string]interface{} `yaml:"proxies"`
	ProxyGroup   []map[string]interface{} `yaml:"proxy-groups"`
	Rule         []string                 `yaml:"rules"`

	// remove after 1.0
	ProxyProviderOld map[string]map[string]interface{} `yaml:"proxy-provider"`
	ProxyOld         []map[string]interface{}          `yaml:"Proxy"`
	ProxyGroupOld    []map[string]interface{}          `yaml:"Proxy Group"`
	RuleOld          []string                          `yaml:"Rule"`
}

func UnmarshalRawConfig

func UnmarshalRawConfig(buf []byte) (*RawConfig, error)

Jump to

Keyboard shortcuts

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