Documentation
¶
Index ¶
- Constants
- type ASN
- type Allocation
- type ID
- type Mapper
- func (m Mapper) ByIP(ip net.IP) (mappings []Mapping, err error)
- func (m Mapper) ByIPString(s string) (mappings []Mapping, err error)
- func (m Mapper) ByNetIPAddr(ip netip.Addr) (mappings []Mapping, err error)
- func (m Mapper) FirstByIP(ip net.IP) (mapping *Mapping, err error)
- func (m Mapper) FirstByIPString(s string) (mapping *Mapping, err error)
- func (m Mapper) FirstByNetIPAddr(ip netip.Addr) (mapping *Mapping, err error)
- func (m Mapper) MaybeFirstByIP(ip net.IP) (mapping *Mapping, err error)
- func (m Mapper) MaybeFirstByIPString(s string) (mapping *Mapping, err error)
- func (m Mapper) MaybeFirstByNetIPAddr(ip netip.Addr) (mapping *Mapping, err error)
- type MapperBuilder
- type Mapping
- type ParseMapperFlags
- type Reference
Constants ¶
View Source
const AddressMappingsURL = "https://thyme.apnic.net/current/data-raw-table"
View Source
const ReferenceURL = "https://thyme.apnic.net/current/data-used-autnums"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocation ¶
type Allocation string
const ( Unassigned Allocation = "unassigned" Unallocated Allocation = "unallocated" Reserved Allocation = "reserved" Allocated Allocation = "allocated" )
type Mapper ¶
type Mapper struct { SourceName string Reference Reference // contains filtered or unexported fields }
func DefaultMapper ¶
func DefaultMapper() Mapper
func DefaultMapperWithReference ¶
func DefaultMapperWithReference(ref Reference, flags ParseMapperFlags) (Mapper, error)
func ParseMapper ¶
func (Mapper) ByNetIPAddr ¶
func (Mapper) FirstByIPString ¶
func (Mapper) FirstByNetIPAddr ¶
func (Mapper) MaybeFirstByIP ¶
func (Mapper) MaybeFirstByIPString ¶
type MapperBuilder ¶
type MapperBuilder struct {
// contains filtered or unexported fields
}
func NewMapperBuilder ¶
func NewMapperBuilder(sourceName string) MapperBuilder
func (MapperBuilder) AddNetwork ¶
func (mb MapperBuilder) AddNetwork(network *net.IPNet, asn ASN) error
func (MapperBuilder) Mappings ¶
func (mb MapperBuilder) Mappings() Mapper
type Mapping ¶
type ParseMapperFlags ¶
type ParseMapperFlags int
const ( IgnoreMissingASN ParseMapperFlags = 1 << iota DropMissingASN )
Click to show internal directories.
Click to hide internal directories.