asnmap

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCIDR

func GetCIDR(output []*Response) ([]*net.IPNet, error)

func GetFormattedDataInCSV

func GetFormattedDataInCSV(output []*Response) ([][]string, error)

func GetFormattedDataInJson

func GetFormattedDataInJson(output []*Response) ([]byte, error)

func ResolveDomain

func ResolveDomain(domain string, customresolvers ...string) ([]string, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
var DefaultClient *Client

func NewClient

func NewClient() (*Client, error)

func (Client) GetData

func (c Client) GetData(input string, medatadas ...string) ([]*Response, error)

func (Client) GetDataWithCustomInput

func (c Client) GetDataWithCustomInput(inputToQuery, inputToUseInResponse string) ([]*Response, error)

func (*Client) SetProxy

func (c *Client) SetProxy(proxyList []string) (*url.URL, error)

SetProxy adds a proxy to the client

type InputType

type InputType uint8
const (
	ASN InputType = iota
	ASNID
	IP
	Org
	Domain
	Unknown
)

func IdentifyInput

func IdentifyInput(input string) InputType

type Response

type Response struct {
	FirstIp string
	LastIp  string
	Input   string
	ASN     int
	Country string
	Org     string
}

To model http response from server

func GetData

func GetData(input string) ([]*Response, error)

type Result

type Result struct {
	Timestamp  string   `json:"timestamp,omitempty" csv:"timestamp"`
	Input      string   `json:"input" csv:"input"`
	ASN        string   `json:"as_number" csv:"as_number"`
	ASN_org    string   `json:"as_name" csv:"as_name"`
	AS_country string   `json:"as_country" csv:"as_country"`
	AS_range   []string `json:"as_range" csv:"as_range"`
}

To model json & csv formatted output

Jump to

Keyboard shortcuts

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