geodata

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPRange

type IPRange struct {
	Start uint32
	End   uint32
}

IPRange represents an IP interval [Start, End]

type IPv6Range

type IPv6Range struct {
	Start [16]byte
	End   [16]byte
}

type Manager

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

func GetInstance

func GetInstance(urls []string) *Manager

GetInstance returns a cached Manager keyed by the rule URL set.

func NewManager

func NewManager(urls []string) *Manager

func (*Manager) MatchCN

func (m *Manager) MatchCN(host string, ip net.IP) (bool, Match)

func (*Manager) MatchRule added in v0.4.5

func (m *Manager) MatchRule(host string, ip net.IP) (bool, Match)

func (*Manager) Update

func (m *Manager) Update()

type Match

type Match struct {
	Kind  string
	Value string
}

func (Match) String

func (m Match) String() string

type RuleSet

type RuleSet struct {
	Payload []string `yaml:"payload"`
}

RuleSet is used to parse YAML-formatted payloads.

Jump to

Keyboard shortcuts

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