iplocation

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 19 Imported by: 0

README

iplocation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type DB

type DB[T any] struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB[T any](dbPath string, sep byte, rangeKind RangeKind, cacheLevel int) (*DB[T], error)

func (*DB[T]) Lookup

func (d *DB[T]) Lookup(addr netip.Addr) (*T, error)

func (*DB[T]) Reload

func (d *DB[T]) Reload() error

type LazyDB

type LazyDB[T any] struct {
	// contains filtered or unexported fields
}

func MustLazyDB

func MustLazyDB[T any](dbPath string, sep byte, rangeKind RangeKind, cacheLevel int, updateInterval time.Duration) *LazyDB[T]

func NewLazyDB

func NewLazyDB[T any](dbPath string, sep byte, rangeKind RangeKind, cacheLevel int, updateInterval time.Duration) (*LazyDB[T], error)

func (*LazyDB[T]) Lookup

func (d *LazyDB[T]) Lookup(addr netip.Addr) (*T, error)

type RangeKind

type RangeKind uint
const (

	// CIDR TODO: not supported
	CIDR RangeKind
	// RawRange TODO: not supported
	RawRange

	DecRange
	HexRange
)

type RawDB

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

func NewRawDB

func NewRawDB(path string, sep byte, rangeKind RangeKind, cacheLevel int) (*RawDB, error)

func (*RawDB) Lookup

func (d *RawDB) Lookup(addr netip.Addr) ([]byte, error)

func (*RawDB) Reload

func (d *RawDB) Reload() error

Directories

Path Synopsis
cmd
iplocation command

Jump to

Keyboard shortcuts

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