config

package
v0.0.0-...-8a5e3ba Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: GPL-3.0 Imports: 20 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

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

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

Parse config

type DNS

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:"-"`
	ExternalUI         string       `json:"-"`
	Secret             string       `json:"-"`
}

General config

Jump to

Keyboard shortcuts

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