facade

package
v0.0.0-...-c1c3985 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClashConfig

type ClashConfig struct {
	RawConfig RawConfig
	// contains filtered or unexported fields
}

Generate Default Clash Configuration

func (*ClashConfig) Collect

func (cc *ClashConfig) Collect(encSubscription string, basedir string, ruleFilename string) error

func (*ClashConfig) Export

func (cc *ClashConfig) Export() ([]byte, error)

func (*ClashConfig) Setup

func (cc *ClashConfig) Setup(client string, cachestore *cache.Cache)

type DNSMode

type DNSMode int
const (
	DNSNormal DNSMode = iota
	DNSFakeIP
	DNSMapping
)

func (DNSMode) MarshalYAML

func (dns_mode DNSMode) MarshalYAML() (any, error)

func (DNSMode) String

func (dns_mode DNSMode) String() string

type Experimental

type Experimental struct{}

type Generator

type Generator interface {
	// function to gather intel
	Collect(encSubscription string, basedir string, ruleFilename string) error

	// export data to bytes
	Export() (data []byte, err error)

	// set up generator with cache
	Setup(client string, cache *cache.Cache)
}

func NewCachedGenerator

func NewCachedGenerator(client string, cache *cache.Cache) Generator

func NewGenerator

func NewGenerator(client string) Generator

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARNING
	ERROR
	SILENT
)

func (LogLevel) MarshalYAML

func (loglevel LogLevel) MarshalYAML() (any, error)

func (LogLevel) String

func (loglevel LogLevel) String() string

type Profile

type Profile struct {
	StoreSelected bool `yaml:"store-selected"`
	StoreFakeIP   bool `yaml:"store-fake-ip"`
}

type RawConfig

type RawConfig struct {
	Port               int        `yaml:"port,omitempty"`
	SocksPort          int        `yaml:"socks-port,omitempty"`
	RedirPort          int        `yaml:"redir-port,omitempty"`
	TProxyPort         int        `yaml:"tproxy-port,omitempty"`
	MixedPort          int        `yaml:"mixed-port,omitempty"`
	Authentication     []string   `yaml:"authentication,omitempty"`
	AllowLan           bool       `yaml:"allow-lan,omitempty"`
	BindAddress        string     `yaml:"bind-address,omitempty"`
	Mode               TunnelMode `yaml:"mode,omitempty"`
	LogLevel           LogLevel   `yaml:"log-level,omitempty"`
	IPv6               bool       `yaml:"ipv6,omitempty"`
	ExternalController string     `yaml:"external-controller,omitempty"`
	ExternalUI         string     `yaml:"external-ui,omitempty"`
	Secret             string     `yaml:"secret,omitempty"`
	Interface          string     `yaml:"interface-name,omitempty"`
	RoutingMark        int        `yaml:"routing-mark,omitempty"`

	ProxyProvider map[string]map[string]any `yaml:"proxy-providers,omitempty"`
	Hosts         map[string]string         `yaml:"hosts,omitempty"`
	DNS           RawDNS                    `yaml:"dns,omitempty"`
	Experimental  Experimental              `yaml:"experimental,omitempty"`
	Profile       Profile                   `yaml:"profile,omitempty"`
	Proxy         []parser.Proxy            `yaml:"proxies,omitempty"`
	ProxyGroup    []map[string]any          `yaml:"proxy-groups,omitempty"`
	Rule          []string                  `yaml:"rules,omitempty"`
}

type RawDNS

type RawDNS struct {
	Enable            bool              `yaml:"enable"`
	IPv6              bool              `yaml:"ipv6"`
	UseHosts          bool              `yaml:"use-hosts"`
	NameServer        []string          `yaml:"nameserver"`
	Fallback          []string          `yaml:"fallback"`
	FallbackFilter    RawFallbackFilter `yaml:"fallback-filter"`
	Listen            string            `yaml:"listen"`
	EnhancedMode      DNSMode           `yaml:"enhanced-mode"`
	FakeIPRange       string            `yaml:"fake-ip-range"`
	FakeIPFilter      []string          `yaml:"fake-ip-filter"`
	DefaultNameserver []string          `yaml:"default-nameserver"`
	NameServerPolicy  map[string]string `yaml:"nameserver-policy"`
}

type RawFallbackFilter

type RawFallbackFilter struct {
	GeoIP     bool     `yaml:"geoip"`
	GeoIPCode string   `yaml:"geoip-code"`
	IPCIDR    []string `yaml:"ipcidr"`
	Domain    []string `yaml:"domain"`
}

type TunnelMode

type TunnelMode int
const (
	Global TunnelMode = iota
	Rule
	Direct
)

func (TunnelMode) MarshalYAML

func (t TunnelMode) MarshalYAML() (any, error)

func (TunnelMode) String

func (t TunnelMode) String() string

Jump to

Keyboard shortcuts

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