Documentation ¶
Index ¶
- Variables
- func Init()
- type Config
- func (c *Config) General() General
- func (c *Config) Parse() error
- func (c *Config) Proxies() map[string]C.Proxy
- func (c *Config) Report() chan<- interface{}
- func (c *Config) Rules() []C.Rule
- func (c *Config) SetLogLevel(level C.LogLevel)
- func (c *Config) SetMode(mode Mode)
- func (c *Config) Subscribe() observable.Subscription
- func (c *Config) UpdateGeneral(general General)
- func (c *Config) UpdateProxy(pc ProxyConfig)
- func (c *Config) UpdateRules() error
- type Event
- type General
- type Mode
- type ProxyConfig
- type RawConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is clash config manager
func (*Config) Report ¶
func (c *Config) Report() chan<- interface{}
Report return a channel for collecting report message
func (*Config) SetLogLevel ¶
SetLogLevel change log level of clash
func (*Config) Subscribe ¶
func (c *Config) Subscribe() observable.Subscription
Subscribe config stream
func (*Config) UpdateGeneral ¶
UpdateGeneral dispatch update event
func (*Config) UpdateProxy ¶
func (c *Config) UpdateProxy(pc ProxyConfig)
UpdateProxy dispatch update proxy event
func (*Config) UpdateRules ¶
UpdateRules is a function for hot reload rules
type General ¶
type General struct { Port int SocksPort int RedirPort int AllowLan bool Mode Mode LogLevel C.LogLevel }
General config
type ProxyConfig ¶
ProxyConfig is update proxy schema
type RawConfig ¶ added in v0.8.0
type RawConfig struct { Port int `yaml:"port"` SocksPort int `yaml:"socks-port"` RedirPort int `yaml:"redir-port"` AllowLan bool `yaml:"allow-lan"` Mode string `yaml:"mode"` LogLevel string `yaml:"log-level"` ExternalController string `yaml:"external-controller"` Secret string `yaml:"secret"` Proxy []map[string]interface{} `yaml:"Proxy"` ProxyGroup []map[string]interface{} `yaml:"Proxy Group"` Rule []string `yaml:"Rule"` }
RawConfig is raw config struct
Click to show internal directories.
Click to hide internal directories.