config

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 19 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dir string) error

Init prepare necessary files

Types

type Config

type Config struct {
	General *General
	DNS     *DNS
	Rules   []C.Rule
	Proxies map[string]C.Proxy
}

Config is clash config manager

func Parse added in v0.10.0

func Parse(path string) (*Config, error)

Parse config

type DNS added in v0.10.0

type DNS struct {
	Enable       bool             `yaml:"enable"`
	IPv6         bool             `yaml:"ipv6"`
	NameServer   []dns.NameServer `yaml:"nameserver"`
	Fallback     []dns.NameServer `yaml:"fallback"`
	Listen       string           `yaml:"listen"`
	EnhancedMode dns.EnhancedMode `yaml:"enhanced-mode"`
}

DNS config

type General

type General struct {
	Port               int          `json:"port"`
	SocksPort          int          `json:"socks-port"`
	RedirPort          int          `json:"redir-port"`
	AllowLan           bool         `json:"allow-lan"`
	Mode               T.Mode       `json:"mode"`
	LogLevel           log.LogLevel `json:"log-level"`
	ExternalController string       `json:"external-controller,omitempty"`
	Secret             string       `json:"secret,omitempty"`
}

General config

Jump to

Keyboard shortcuts

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