clash

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUBSCRIBE_DIR = "subscribe"
	CLASH_DIR     = "clash"
	CONFIG_FN     = "config.yaml"
)

Variables

This section is empty.

Functions

func Backward

func Backward(ctx context.Context) (err error)

func DNSDefault

func DNSDefault() func(cfg *config.Config)

func Forward

func Forward(ctx context.Context, redirPort int) (err error)

func GeneralDefault

func GeneralDefault() func(cfg *config.Config)

Types

type Config

type Config struct {
	Current   string //当前配置名称
	Subscribe []*Subscribe
}

配置

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(homeDir string) *Service

func (*Service) Run

func (s *Service) Run(ctx context.Context) (err error)

开始运行

type Subscribe

type Subscribe struct {
	Name    string   //显示名称
	Url     string   //更新链接
	Method  string   //更新时使用的HTTP方法
	Headers []string //更新时使用的HTTP请求头
	Body    string   //更新请求的Body参数
	Cron    string   //更新计划
	// contains filtered or unexported fields
}

订阅

Jump to

Keyboard shortcuts

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