parser

package
v0.0.0-...-48c782e Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSDecodeURI

func JSDecodeURI(s string) (r string)

func TrimAnchor

func TrimAnchor(s string) string

Types

type Content

type Content struct {
	XMLName    xml.Name `xml:"content"`
	Domain     []string `xml:"domain"`
	IP         []string `xml:"ip"`
	IPSubnet   []string `xml:"ipSubnet"`
	URL        []string `xml:"url"`
	BlockType  string   `xml:"-"`
	EntityType string   `xml:"-"`
}

type DB

type DB struct {
	WhiteIp     List
	WhiteDomain List
	AllIPs      List
	HTTPSIPs    List
	BlockedIPs  List
	URLs        List
	DomainMasks List
	Domains     List
	Subnets     List
	SocNets     List
	SocDomains  List
}

func NewDB

func NewDB() *DB

func (*DB) ParseEl

func (db *DB) ParseEl(item Content)

func (*DB) ParseSoc

func (db *DB) ParseSoc(item SocRecord)

func (*DB) WriteFiles

func (db *DB) WriteFiles(dir string) error

func (*DB) WriteSocialFiles

func (db *DB) WriteSocialFiles(dir string) error

type List

type List map[string]bool

func (List) Add

func (l List) Add(s string)

func (List) MixWriteFile

func (l List) MixWriteFile(fn string, lists ...List) error

func (List) MixWriteFilef

func (l List) MixWriteFilef(format string, fn string, lists ...List) error

func (List) WriteFile

func (l List) WriteFile(fn string) error

func (List) WriteFilef

func (l List) WriteFilef(format string, fn string) error

type SocRecord

type SocRecord struct {
	XMLName     xml.Name  `xml:"content"`
	ID          int       `xml:"-"`
	IncludeTime time.Time `xml:"-"`
	Hash        string    `xml:"-"`
	Name        string    `xml:"resourceName"`
	Domain      string    `xml:"domain"`
	Subnets     []string  `xml:"ipSubnet"`
}

Jump to

Keyboard shortcuts

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