ip

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTarGz

func ExtractTarGz(r io.Reader, dest string) error

ExtractTarGz extracts a gzipped stream to dest

func FindFile

func FindFile(root, r string) (string, string, error)

FindFile returns a path to a file matching regex under root Returns

string: Full path
string: File name
error : Error

func MoveFile

func MoveFile(sourcePath, destPath string) error

func ParseIPs

func ParseIPs(body []byte, expression []string) []string

func ParseSubnet

func ParseSubnet(ip, ipSub string, subnet byte) bool

func VerifyMD5HashFromFile

func VerifyMD5HashFromFile(file, md5sumFile string) error

Types

type Maxmind

type Maxmind struct {
	// contains filtered or unexported fields
}

func NewMaxmind

func NewMaxmind(cfg *config.Config, license string, logger logrus.FieldLogger) *Maxmind

func (*Maxmind) DownloadAndUpdate

func (m *Maxmind) DownloadAndUpdate() error

func (*Maxmind) GetASN

func (m *Maxmind) GetASN(ip net.IP) (company string, asn uint, err error)

func (*Maxmind) GetCityData

func (m *Maxmind) GetCityData(ip net.IP) (postalcode string, timezone string, city string, latitude, longitude float64, err error)

func (*Maxmind) GetCountry

func (m *Maxmind) GetCountry(ip net.IP) (country string, err error)

Jump to

Keyboard shortcuts

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