common

package
v0.0.12-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProxy

func AddProxy(
	sub *model.Subscription, autotest bool,
	lazy bool, clashType model.ClashType, proxies ...proxy.Proxy,
)

func AppendRules

func AppendRules(sub *model.Subscription, rules ...string)

func AppenddRuleProvider

func AppenddRuleProvider(
	sub *model.Subscription, providerName string, group string, provider model.RuleProvider,
)

func BuildSub

func BuildSub(clashType model.ClashType, query model.SubConfig, template string, cacheExpire int64, retryTimes int) (
	*model.Subscription, error,
)

func FetchSubscriptionFromAPI

func FetchSubscriptionFromAPI(url string, userAgent string, retryTimes int) ([]byte, error)

func FetchSubscriptionUserInfo

func FetchSubscriptionUserInfo(url string, userAgent string, retryTimes int) (string, error)

func GetContryName

func GetContryName(countryKey string) string

func LoadSubscription

func LoadSubscription(url string, refresh bool, userAgent string, cacheExpire int64, retryTimes int) ([]byte, error)

func LoadTemplate

func LoadTemplate(templatePath string) ([]byte, error)

func MKDir

func MKDir(dir string) error

func MergeSubAndTemplate

func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription, igcg bool)

func MkEssentialDir

func MkEssentialDir() error

func PrependRuleProvider

func PrependRuleProvider(
	sub *model.Subscription, providerName string, group string, provider model.RuleProvider,
)

func PrependRules

func PrependRules(sub *model.Subscription, rules ...string)

func RandomString

func RandomString(length int) string

func Request

func Request(retryTimes int) *resty.Client

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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