db

package
v0.0.0-...-933fec0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGODB_USER = "test"
	MONGODB_PASS = "test"
	MONGODB_IP   = "localhost"
	MONGODB_DB   = "masscan_go"
)

Variables

This section is empty.

Functions

func AsnDetailsMongo

func AsnDetailsMongo(
	ad AsnDetails, apr AsnPrefixes, ape AsnPeers, wd WhoisDetails,
) error

Types

type AsnDetails

type AsnDetails struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	Data          struct {
		Asn              int         `json:"asn"`
		Name             interface{} `json:"name"`
		DescriptionShort string      `json:"description_short"`
		DescriptionFull  []string    `json:"description_full"`
		CountryCode      string      `json:"country_code"`
		Website          interface{} `json:"website"`
	} `json:"data"`
}

type AsnPeers

type AsnPeers struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	Data          struct {
		Ipv4Peers []struct {
			Asn         int         `json:"asn"`
			Name        interface{} `json:"name"` // seems to be always null
			Description string      `json:"description"`
			CountryCode string      `json:"country_code"`
		} `json:"ipv4_peers"`
		Ipv6Peers []struct {
			Asn         int         `json:"asn"`
			Name        interface{} `json:"name"`
			Description string      `json:"description"`
			CountryCode string      `json:"country_code"`
		} `json:"ipv6_peers"`
	} `json:"data"`
}

type AsnPrefixes

type AsnPrefixes struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	Data          struct {
		Ipv4Prefixes []struct {
			// Prefix string `json:"prefix"`
			IP          string `json:"ip"`
			Cidr        int    `json:"cidr"`
			Name        string `json:"name"`
			Description string `json:"description"`
			CountryCode string `json:"country_code"`
			Parent      struct {
				Prefix string `json:"prefix"`
				IP     string `json:"ip"`
				Cidr   int    `json:"cidr"`
			} `json:"parent"`
		} `json:"ipv4_prefixes"`
		Ipv6Prefixes []struct {
			// Prefix string `json:"prefix"`
			IP          string `json:"ip"`
			Cidr        int    `json:"cidr"`
			Name        string `json:"name"`
			Description string `json:"description"`
			CountryCode string `json:"country_code"`
			Parent      struct {
				Prefix string `json:"prefix"`
				IP     string `json:"ip"`
				Cidr   int    `json:"cidr"`
			} `json:"parent"`
		} `json:"ipv6_prefixes"`
	} `json:"data"`
}

type DBClient

type DBClient struct {
	Client *mongo.Client
	Ctx    context.Context
	Cancel context.CancelFunc
}
var DB DBClient

type WhoisDetails

type WhoisDetails struct {
	Organisation map[string]string
	Autnum       map[string]string
	Persons      []map[string]string
}

Jump to

Keyboard shortcuts

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