model

package
v0.0.13-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CountryChineseName = map[string]string{}/* 258 elements not displayed */
View Source
var CountryEnglishName = map[string]string{}/* 253 elements not displayed */
View Source
var CountryFlag = map[string]string{}/* 259 elements not displayed */
View Source
var CountryISO = map[string]string{}/* 258 elements not displayed */

Functions

func GetSupportProxyTypes

func GetSupportProxyTypes(clashType ClashType) map[string]bool

Types

type ClashType

type ClashType int
const (
	Clash ClashType = 1 + iota
	ClashMeta
)

type ConvertConfig added in v1.0.0

type ConvertConfig struct {
	ClashType           ClashType            `json:"clashType" binding:"required"`
	Subs                []string             `json:"subscriptions" binding:""`
	Proxies             []string             `json:"proxies" binding:""`
	Refresh             bool                 `json:"refresh" binding:""`
	Template            string               `json:"template" binding:""`
	RuleProviders       []RuleProviderStruct `json:"ruleProviders" binding:""`
	Rules               []RuleStruct         `json:"rules" binding:""`
	AutoTest            bool                 `json:"autoTest" binding:""`
	Lazy                bool                 `json:"lazy" binding:""`
	Sort                string               `json:"sort" binding:""`
	Remove              string               `json:"remove" binding:""`
	Replace             map[string]string    `json:"replace" binding:""`
	NodeListMode        bool                 `json:"nodeList" binding:""`
	IgnoreCountryGrooup bool                 `json:"ignoreCountryGroup" binding:""`
	UserAgent           string               `json:"userAgent" binding:""`
	UseUDP              bool                 `json:"useUDP" binding:""`
}

func ParseConvertQuery added in v1.0.0

func ParseConvertQuery(c *gin.Context) (ConvertConfig, error)

type NodeList

type NodeList struct {
	Proxy []proxy.Proxy `yaml:"proxies,omitempty" json:"proxies"`
}

type Payload

type Payload struct {
	Rules []string `yaml:"payload,omitempty"`
}

type ProxyGroup

type ProxyGroup struct {
	Type                string   `yaml:"type,omitempty"`
	Name                string   `yaml:"name,omitempty"`
	Proxies             []string `yaml:"proxies,omitempty"`
	IsCountryGrop       bool     `yaml:"-"`
	Url                 string   `yaml:"url,omitempty"`
	Interval            int      `yaml:"interval,omitempty"`
	Tolerance           int      `yaml:"tolerance,omitempty"`
	Lazy                bool     `yaml:"lazy"`
	Size                int      `yaml:"-"`
	DisableUDP          bool     `yaml:"disable-udp,omitempty"`
	Strategy            string   `yaml:"strategy,omitempty"`
	Icon                string   `yaml:"icon,omitempty"`
	Timeout             int      `yaml:"timeout,omitempty"`
	Use                 []string `yaml:"use,omitempty"`
	InterfaceName       string   `yaml:"interface-name,omitempty"`
	RoutingMark         int      `yaml:"routing-mark,omitempty"`
	IncludeAll          bool     `yaml:"include-all,omitempty"`
	IncludeAllProxies   bool     `yaml:"include-all-proxies,omitempty"`
	IncludeAllProviders bool     `yaml:"include-all-providers,omitempty"`
	Filter              string   `yaml:"filter,omitempty"`
	ExcludeFilter       string   `yaml:"exclude-filter,omitempty"`
	ExpectedStatus      int      `yaml:"expected-status,omitempty"`
	Hidden              bool     `yaml:"hidden,omitempty"`
}

type ProxyGroupsSortByName

type ProxyGroupsSortByName []ProxyGroup

func (ProxyGroupsSortByName) Len

func (p ProxyGroupsSortByName) Len() int

func (ProxyGroupsSortByName) Less

func (p ProxyGroupsSortByName) Less(i, j int) bool

func (ProxyGroupsSortByName) Swap

func (p ProxyGroupsSortByName) Swap(i, j int)

type ProxyGroupsSortBySize

type ProxyGroupsSortBySize []ProxyGroup

func (ProxyGroupsSortBySize) Len

func (p ProxyGroupsSortBySize) Len() int

func (ProxyGroupsSortBySize) Less

func (p ProxyGroupsSortBySize) Less(i, j int) bool

func (ProxyGroupsSortBySize) Swap

func (p ProxyGroupsSortBySize) Swap(i, j int)

type RuleProvider

type RuleProvider struct {
	Type     string `yaml:"type,omitempty"`
	Behavior string `yaml:"behavior,omitempty"`
	Url      string `yaml:"url,omitempty"`
	Path     string `yaml:"path,omitempty"`
	Interval int    `yaml:"interval,omitempty"`
	Format   string `yaml:"format,omitempty"`
}

type RuleProviderStruct

type RuleProviderStruct struct {
	Behavior string `json:"behavior" binding:""`
	Url      string `json:"url" binding:""`
	Group    string `json:"group" binding:""`
	Prepend  bool   `json:"prepend" binding:""`
	Name     string `json:"name" binding:""`
}

type RuleStruct

type RuleStruct struct {
	Rule    string `json:"rule" binding:""`
	Prepend bool   `json:"prepend" binding:""`
}
type ShortLink struct {
	Hash            string
	Url             string
	Password        string
	LastRequestTime int64
}

type Subscription

type Subscription struct {
	Port                    int            `yaml:"port,omitempty" json:"port"`
	SocksPort               int            `yaml:"socks-port,omitempty" json:"socks-port"`
	RedirPort               int            `yaml:"redir-port,omitempty" json:"redir-port"`
	TProxyPort              int            `yaml:"tproxy-port,omitempty" json:"tproxy-port"`
	MixedPort               int            `yaml:"mixed-port,omitempty" json:"mixed-port"`
	ShadowSocksConfig       string         `yaml:"ss-config,omitempty" json:"ss-config"`
	VmessConfig             string         `yaml:"vmess-config,omitempty" json:"vmess-config"`
	InboundTfo              bool           `yaml:"inbound-tfo,omitempty" json:"inbound-tfo"`
	InboundMPTCP            bool           `yaml:"inbound-mptcp,omitempty" json:"inbound-mptcp"`
	Authentication          []string       `yaml:"authentication,omitempty" json:"authentication"`
	SkipAuthPrefixes        []netip.Prefix `yaml:"skip-auth-prefixes,omitempty" json:"skip-auth-prefixes"`
	LanAllowedIPs           []netip.Prefix `yaml:"lan-allowed-ips,omitempty" json:"lan-allowed-ips"`
	LanDisAllowedIPs        []netip.Prefix `yaml:"lan-disallowed-ips,omitempty" json:"lan-disallowed-ips"`
	AllowLan                bool           `yaml:"allow-lan,omitempty" json:"allow-lan"`
	BindAddress             string         `yaml:"bind-address,omitempty" json:"bind-address"`
	Mode                    string         `yaml:"mode,omitempty" json:"mode"`
	UnifiedDelay            bool           `yaml:"unified-delay,omitempty" json:"unified-delay"`
	LogLevel                string         `yaml:"log-level,omitempty" json:"log-level"`
	IPv6                    bool           `yaml:"ipv6,omitempty" json:"ipv6"`
	ExternalController      string         `yaml:"external-controller,omitempty" json:"external-controller"`
	ExternalControllerPipe  string         `yaml:"external-controller-pipe,omitempty" json:"external-controller-pipe"`
	ExternalControllerUnix  string         `yaml:"external-controller-unix,omitempty" json:"external-controller-unix"`
	ExternalControllerTLS   string         `yaml:"external-controller-tls,omitempty" json:"external-controller-tls"`
	ExternalControllerCors  C.RawCors      `yaml:"external-controller-cors,omitempty" json:"external-controller-cors"`
	ExternalUI              string         `yaml:"external-ui,omitempty" json:"external-ui"`
	ExternalUIURL           string         `yaml:"external-ui-url,omitempty" json:"external-ui-url"`
	ExternalUIName          string         `yaml:"external-ui-name,omitempty" json:"external-ui-name"`
	ExternalDohServer       string         `yaml:"external-doh-server,omitempty" json:"external-doh-server"`
	Secret                  string         `yaml:"secret,omitempty" json:"secret"`
	Interface               string         `yaml:"interface-name,omitempty" json:"interface-name"`
	RoutingMark             int            `yaml:"routing-mark,omitempty" json:"routing-mark"`
	Tunnels                 []LC.Tunnel    `yaml:"tunnels,omitempty" json:"tunnels"`
	GeoAutoUpdate           bool           `yaml:"geo-auto-update,omitempty" json:"geo-auto-update"`
	GeoUpdateInterval       int            `yaml:"geo-update-interval,omitempty" json:"geo-update-interval"`
	GeodataMode             bool           `yaml:"geodata-mode,omitempty" json:"geodata-mode"`
	GeodataLoader           string         `yaml:"geodata-loader,omitempty" json:"geodata-loader"`
	GeositeMatcher          string         `yaml:"geosite-matcher,omitempty" json:"geosite-matcher"`
	TCPConcurrent           bool           `yaml:"tcp-concurrent,omitempty" json:"tcp-concurrent"`
	FindProcessMode         string         `yaml:"find-process-mode,omitempty" json:"find-process-mode"`
	GlobalClientFingerprint string         `yaml:"global-client-fingerprint,omitempty" json:"global-client-fingerprint"`
	GlobalUA                string         `yaml:"global-ua,omitempty" json:"global-ua"`
	ETagSupport             bool           `yaml:"etag-support,omitempty" json:"etag-support"`
	KeepAliveIdle           int            `yaml:"keep-alive-idle,omitempty" json:"keep-alive-idle"`
	KeepAliveInterval       int            `yaml:"keep-alive-interval,omitempty" json:"keep-alive-interval"`
	DisableKeepAlive        bool           `yaml:"disable-keep-alive,omitempty" json:"disable-keep-alive"`

	ProxyProvider map[string]map[string]any `yaml:"proxy-providers,omitempty" json:"proxy-providers"`
	RuleProvider  map[string]RuleProvider   `yaml:"rule-providers,omitempty" json:"rule-providers"`
	Proxy         []proxy.Proxy             `yaml:"proxies,omitempty" json:"proxies"`
	ProxyGroup    []ProxyGroup              `yaml:"proxy-groups,omitempty" json:"proxy-groups"`
	Rule          []string                  `yaml:"rules,omitempty" json:"rule"`
	SubRules      map[string][]string       `yaml:"sub-rules,omitempty" json:"sub-rules"`
	Listeners     []map[string]any          `yaml:"listeners,omitempty" json:"listeners"`
	Hosts         map[string]any            `yaml:"hosts,omitempty" json:"hosts"`
	DNS           C.RawDNS                  `yaml:"dns,omitempty" json:"dns"`
	NTP           C.RawNTP                  `yaml:"ntp,omitempty" json:"ntp"`
	Tun           C.RawTun                  `yaml:"tun,omitempty" json:"tun"`
	TuicServer    C.RawTuicServer           `yaml:"tuic-server,omitempty" json:"tuic-server"`
	IPTables      C.RawIPTables             `yaml:"iptables,omitempty" json:"iptables"`
	Experimental  C.RawExperimental         `yaml:"experimental,omitempty" json:"experimental"`
	Profile       C.RawProfile              `yaml:"profile,omitempty" json:"profile"`
	GeoXUrl       C.RawGeoXUrl              `yaml:"geox-url,omitempty" json:"geox-url"`
	Sniffer       C.RawSniffer              `yaml:"sniffer,omitempty" json:"sniffer"`
	TLS           C.RawTLS                  `yaml:"tls,omitempty" json:"tls"`

	ClashForAndroid C.RawClashForAndroid `yaml:"clash-for-android,omitempty" json:"clash-for-android"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/config/config.go RawConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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