config

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifyDisabled = 0
	NotifyIfError  = 1
	NotifyAll      = 2
)
View Source
const RegexpPrefix = `regexp:`

Variables

View Source
var TTLs = echo.NewKVData().
	Add(``, `自动`).Add(`1`, `1秒`).Add(`5`, `5秒`).Add(`10`, `10秒`).
	Add(`60`, `1分钟`).Add(`120`, `2分钟`).Add(`300`, `5分钟`).
	Add(`600`, `10分钟`).Add(`1800`, `30分钟`).
	Add(`3600`, `1小时`)

Functions

This section is empty.

Types

type Config

type Config struct {
	Closed         bool
	IPv4           *NetIPConfig
	IPv6           *NetIPConfig
	DNSServices    []*DNSService
	DNSResolver    string            // example: 8.8.8.8
	NotifyMode     int               // 0-关闭通知; 1-仅仅出错时发送通知;2-发送全部通知
	NotifyTemplate map[string]string // 通知模板{html:"",markdown:""}
	Interval       time.Duration
}

func New

func New() *Config

func (*Config) AfterValidate

func (c *Config) AfterValidate(ctx echo.Context) error

func (*Config) BeforeValidate

func (c *Config) BeforeValidate(ctx echo.Context) error

func (*Config) BinderKeyNormalizer

func (c *Config) BinderKeyNormalizer(key string) string

func (*Config) Commit

func (c *Config) Commit() error

func (*Config) FindService

func (c *Config) FindService(provider string) *DNSService

func (*Config) IsValid

func (c *Config) IsValid() bool

type DNSDomain

type DNSDomain struct {
	IPFormat string // IP格式模板(支持变量标签#{ip})
	Domain   string // 域名
	Line     string // 线路类型
	Extra    echo.H // 扩展数据
}

type DNSService

type DNSService struct {
	Enabled     bool
	Provider    string
	Settings    echo.H
	IPv4Domains []*DNSDomain
	IPv6Domains []*DNSDomain
}

func (*DNSService) Clone

func (d *DNSService) Clone() *DNSService

type Filter

type Filter struct {
	Include string

	Exclude string
	// contains filtered or unexported fields
}

func (*Filter) Init

func (f *Filter) Init() (err error)

func (*Filter) Match

func (f *Filter) Match(ip string) bool

type NetIPConfig

type NetIPConfig struct {
	Enabled      bool
	Type         string // netInterface / api
	NetInterface *NetInterface
	NetIPApiUrl  string
}

func NewNetIPConfig

func NewNetIPConfig() *NetIPConfig

type NetInterface

type NetInterface struct {
	Name   string
	Filter *Filter
}

func NewNetInterface

func NewNetInterface() *NetInterface

Jump to

Keyboard shortcuts

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