convert

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package convert transforms a GeoIP2/GeoLite2 CSV to various formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(
	input io.Reader,
	output io.Writer,
	cidr bool,
	ipRange bool,
	intRange bool,
	hexRange bool,
) error

Convert writes the MaxMind GeoIP2 or GeoLite2 CSV in the `input` io.Reader to the Writer `output` using the network representation specified by setting `cidr`, ipRange`, or `intRange` to true. If none of these are set to true, it will strip off the network information.

func ConvertFile

func ConvertFile(
	inputFile string,
	outputFile string,
	cidr bool,
	ipRange bool,
	intRange bool,
	hexRange bool,
) error

ConvertFile converts the MaxMind GeoIP2 or GeoLite2 CSV file `inputFile` to `outputFile` file using a different representation of the network. The representation can be specified by setting one or more of `cidr`, `ipRange`, `intRange` or `hexRange` to true. If none of these are set to true, it will strip off the network information.

Types

This section is empty.

Jump to

Keyboard shortcuts

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