resolveip

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: Apache-2.0 Imports: 5 Imported by: 1

README

Build Status

resolveip

resolveip finds IP addresses (both IPv4 and IPv6 by default) in texts and resolves them using the system's local resolver. It is primarily meant as an interactive tool but can also read from files and pipes.

screencast

When reading files (this includes dropping text files on the resolveip icon) on Windows, resolveip adds the console input to the list of inputs. This keeps the console window open after reading all initial inputs. To use resolveip in pipes on Windows, add the -batch flag.

Binary releases

Binaries for Linux, macOS and Windows are automatically built by travis-ci and available on the project's releases page.

Note to macOS users: Open the DMG, copy resolveip into your $PATH and remove the quarantine attribute if necessary:

xattr -rd com.apple.quarantine resolveip

Building from source

Get Go

Install and configure the Go toolchain. Most Linux distributions already have it packaged. Homebrew also has a package.

Get the source
go get github.com/hreese/resolveip/...
# install this if you want to compile for Windows
go git github.com/josephspurrier/goversioninfo/cmd/goversioninfo
Build
Build for your local architecture
go install github.com/hreese/resolveip/cmd/resolveip
Build and package for all supported architectures
cd $GOPATH/src/github.com/hreese/resolveip
make

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(input string) string

Delete returns an empty string

func NOP

func NOP(input string) string

NOP simply returns the input string

Types

type InfoReader

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

func NewInfoWriter

func NewInfoWriter(msg string, out io.Writer) *InfoReader

func (*InfoReader) Read

func (ir *InfoReader) Read(p []byte) (n int, err error)

type OutputConfig

type OutputConfig struct {
	Nonmatch          TextMutator
	ResolvedMatch     TextMutator
	UnresolvableMatch TextMutator
	Result            TextMutator
}

type ResolverFunc

type ResolverFunc func(string, [][]int) string

func MakeResolver

func MakeResolver(out OutputConfig) ResolverFunc

type TextMutator

type TextMutator func(string) string

TextMutator changes a given string

func Chain

func Chain(mfuncs ...TextMutator) TextMutator

Chain returns a new TextMutator that applies all given TextMutator functions in order

func GenHighlighter

func GenHighlighter(attr ...color.Attribute) TextMutator

GenHighlighter returns a new TextMutator that colorizes the input string

func GenQuoter

func GenQuoter(before, after string) TextMutator

GenQuoter returns a new TextMutator that surrounds the input string with custom strings

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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