geosite_antizapret

package
v0.0.0-...-3a38c00 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AntizapretPACGeneratorLightUpstreamBaseURL = "https://bitbucket.org/anticensority/antizapret-pac-generator-light/raw/master/config/"

	ExcludeHostsByIPsDist = "exclude-hosts-by-ips-dist.txt"
	ExcludeHostsDist      = "exclude-hosts-dist.txt"
	ExcludeIPsDist        = "exclude-ips-dist.txt"
	ExcludeRegexpDist     = "exclude-regexp-dist.awk"

	IncludeHostsDist = "include-hosts-dist.txt"
	IncludeIPsDist   = "include-ips-dist.txt"
)
View Source
const DefaultDownloadURL = "https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv"

Variables

This section is empty.

Functions

This section is empty.

Types

type AntizapretConfig

type AntizapretConfig struct {
	Type    AntizapretConfigType
	Exclude bool
	URL     string
}

type AntizapretConfigType

type AntizapretConfigType string
const (
	IPs        AntizapretConfigType = "ips"
	Hosts      AntizapretConfigType = "hosts"
	HostsByIPs AntizapretConfigType = "hosts_by_ips"
	Regexp     AntizapretConfigType = "regexp"
)

type Configs

type Configs struct {
	ExcludeHosts  []string
	ExcludeIPs    []netip.Addr
	ExcludeRegexp []*regexp.Regexp

	IncludeHosts []string
	IncludeIPs   []*net.IPNet
}

type Generator

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

func NewGenerator

func NewGenerator(opts ...GeneratorOption) *Generator

func (*Generator) GenerateAndUpload

func (g *Generator) GenerateAndUpload(ctx context.Context) error

func (*Generator) GenerateAndWrite

func (g *Generator) GenerateAndWrite() error

type GeneratorOption

type GeneratorOption func(*Generator)

func WithDownloadURL

func WithDownloadURL(downloadURL string) GeneratorOption

func WithGitHubClient

func WithGitHubClient(pat, owner, repo string) GeneratorOption

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) GeneratorOption

Jump to

Keyboard shortcuts

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