database

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewBuilder

func NewBuilder() *builder

NewBuilder creates a builder.

Types

type AutonomousSystem

type AutonomousSystem struct {
	// Number (aka ASN) is the unique identifier for an Autonomous System.
	Number uint32
}

AutonomousSystem represents an Autonomous System on the Internet.

type Database

type Database interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
	// Lookup returns the AutonomousSystem for a given net.IP.
	Lookup(net.IP) (AutonomousSystem, error)
}

Database stores mappings between IP addresses and Autonomous Systems.

func NewFromDump

func NewFromDump(r io.Reader) (Database, error)

Jump to

Keyboard shortcuts

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