Categorygithub.com/open-dynaMIX/anonip-go
modulepackage
0.0.0-alpha.1
Repository: https://github.com/open-dynamix/anonip-go.git
Documentation: pkg.go.dev

# README

anonip-go

Build Status Coverage goreport License

WIP

Anonip rewritten in go.

This is WIP and mainly serves an educational purpose at this time.

Usage

Usage: anonip [--ipv4mask INTEGER] [--ipv6mask INTEGER] [--increment INTEGER] [--output FILE] [--input FILE] [--columns INTEGER [INTEGER ...]] [--delimiter STRING] [--replace STRING] [--regex STRING [STRING ...]] [--skip-private] [--version]

Options:
  --ipv4mask INTEGER, -4 INTEGER
                         truncate the last n bits [default: 12]
  --ipv6mask INTEGER, -6 INTEGER
                         truncate the last n bits [default: 84]
  --increment INTEGER, -i INTEGER
                         increment the IP address by n [default: 0]
  --output FILE, -o FILE
                         file or FIFO to write to [default: stdout]
  --input FILE           file or FIFO to read from [default: stdin]
  --columns INTEGER [INTEGER ...], -c INTEGER [INTEGER ...]
                         assume IP address is in column n (1-based indexed) [default: 0]
  --delimiter STRING, -l STRING
                         log delimiter [default:  ]
  --replace STRING, -r STRING
                         replacement string in case address parsing fails (Example: 0.0.0.0)
  --regex STRING [STRING ...]
                         regex
  --skip-private, -p     do not mask addresses in private ranges. See IANA Special-Purpose Address Registry [default: false]
  --version, -v          show program's version number and exit [default: false]
  --help, -h             display this help and exit

All Options can also be set via environment variables:

  • ANONIP_IPV4MASK
  • ANONIP_IPV6MASK
  • ANONIP_INCREMENT
  • ANONIP_OUTPUT
  • ANONIP_OUTPUT
  • ANONIP_COLUMNS
  • ANONIP_DELIMITER
  • ANONIP_REPLACE
  • ANONIP_REGEX
  • ANONIP_SKIP_PRIVATE

# Functions

OpenFile is a wrapper around os.OpenFile for better control in tests.

# Structs

Args will hold parsed CLI arguments.