store

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package store is a storage for storing ip frequency.

TODO: This may prove to be too much memory consuming. Need to run some benchmarks with very large target sizes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPMeta

type IPMeta struct {
	// we store also the ip itself as we will need it later for filtering
	IP string
	// Hostnames contains the list of hostnames for the IP
	Hostnames map[string]struct{}
	// Counter is the number of times the same ip was found for hosts
	Counter int
}

IPMeta contains meta-information about a single IP address found during enumeration.

type Store

type Store struct {
	IP map[string]*IPMeta
}

Store is a storage for ip based wildcard removal

func New

func New() *Store

New creates a new storage for ip based wildcard removal

func (*Store) Close

func (s *Store) Close()

Close removes all the references to arrays and releases memory to the gc

func (*Store) Delete

func (s *Store) Delete(ip string)

Delete deletes the records for an IP from store.

func (*Store) Exists

func (s *Store) Exists(ip string) bool

Exists indicates if an IP exists in the map

func (*Store) Get

func (s *Store) Get(ip string) *IPMeta

Get gets the meta-information for an IP address from the map.

func (*Store) New

func (s *Store) New(ip, hostname string)

New creates a new ip-hostname pair in the map

Jump to

Keyboard shortcuts

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