singgeo

package
v0.0.0-...-9627cf2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

README

singgeo

Modified from https://github.com/SagerNet/sing-box/tree/dev-next/common/geosite

License: GPLv3 or later

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(writer io.Writer, domains map[string][]Item) error

Types

type GeoSiteReader

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

func LoadSite

func LoadSite(data []byte) (reader *GeoSiteReader, codes []string, err error)

func LoadSiteFromFile

func LoadSiteFromFile(path string) (*GeoSiteReader, []string, error)

func (*GeoSiteReader) Read

func (r *GeoSiteReader) Read(code string) ([]Item, error)

type Item

type Item struct {
	Type  ItemType
	Value string
}

type ItemType

type ItemType = uint8
const (
	RuleTypeDomain ItemType = iota
	RuleTypeDomainSuffix
	RuleTypeDomainKeyword
	RuleTypeDomainRegex
)

Jump to

Keyboard shortcuts

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