lib

package
v0.0.0-...-8ef8941 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DomainRegex = regexp.MustCompile(`(?:[a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}|(?:[^\s.]+\.)+[^\s]{2,}`)

Functions

func ActionForCIDR

func ActionForCIDR(input string) error

func ActionForCIDRUpper

func ActionForCIDRUpper(input string) error

func ActionForISLoopBackRange

func ActionForISLoopBackRange(input string)

func ActionForIsLoopBack

func ActionForIsLoopBack(input string)

func ActionForIsLoopBackCIDR

func ActionForIsLoopBackCIDR(input string)

func ActionForIsMulticast

func ActionForIsMulticast(input string)

func ActionForIsMulticastCIDR

func ActionForIsMulticastCIDR(input string)

func ActionForIsMulticastRange

func ActionForIsMulticastRange(input string)

func ActionForIsV4

func ActionForIsV4(input string)

func ActionForIsV4CIDR

func ActionForIsV4CIDR(input string)

func ActionForIsV4Range

func ActionForIsV4Range(input string)

func ActionForIsV6

func ActionForIsV6(input string)

func ActionForIsV6CIDR

func ActionForIsV6CIDR(input string)

func ActionForIsV6Range

func ActionForIsV6Range(input string)

func ActionForRange

func ActionForRange(input string) error

func ActionForRangeUpper

func ActionForRangeUpper(input string) error

func ActionIsGlobalUnicast

func ActionIsGlobalUnicast(input string)

func ActionIsGlobalUnicastCIDR

func ActionIsGlobalUnicastCIDR(input string)

func ActionIsGlobalUnicastRange

func ActionIsGlobalUnicastRange(input string)

func ActionIsInterfaceLocalMulticast

func ActionIsInterfaceLocalMulticast(input string)

func ActionIsInterfaceLocalMulticastCIDR

func ActionIsInterfaceLocalMulticastCIDR(input string)

func ActionIsInterfaceLocalMulticastRange

func ActionIsInterfaceLocalMulticastRange(input string)

func ActionIsLinkLocalMulticast

func ActionIsLinkLocalMulticast(input string)

func ActionIsLinkLocalMulticastCIDR

func ActionIsLinkLocalMulticastCIDR(input string)

func ActionIsLinkLocalMulticastRange

func ActionIsLinkLocalMulticastRange(input string)

func ActionIsLinkLocalUnicast

func ActionIsLinkLocalUnicast(input string)

func ActionIsLinkLocalUnicastCIDR

func ActionIsLinkLocalUnicastCIDR(input string)

func ActionIsLinkLocalUnicastRange

func ActionIsLinkLocalUnicastRange(input string)

func ActionIsUnspecified

func ActionIsUnspecified(input string)

func CmdASNBulk

func CmdASNBulk(f CmdASNBulkFlags, ii *ipinfo.Client, args []string, printHelp func()) (ipinfo.BatchASNDetails, error)

CmdASNBulk is the entrypoint for the `ipinfo asn-bulk` command.

func CmdCIDR2IP

func CmdCIDR2IP(f CmdCIDR2IPFlags, args []string, printHelp func()) error

func CmdCIDR2Range

func CmdCIDR2Range(
	f CmdCIDR2RangeFlags,
	args []string,
	printHelp func(),
) error

CmdCIDR2Range is the common core logic for the cidr2range command.

func CmdCalc

func CmdCalc(f CmdCalcFlags, args []string, printHelp func()) error

CmdCalc Function is the handler for the "calc" command.

func CmdGrepDomain

func CmdGrepDomain(f CmdGrepDomainFlags, args []string, printHelp func()) error

CmdGrepDomain is the common core logic for the grepdomain command.

func CmdGrepIP

func CmdGrepIP(
	f CmdGrepIPFlags,
	args []string,
	printHelp func(),
) error

CmdGrepIP is the common core logic for the grepip command.

func CmdMatchIP

func CmdMatchIP(
	f CmdMatchIPFlags,
	args []string,
	printHelp func(),
) error

func CmdPrips

func CmdPrips(
	f CmdPripsFlags,
	args []string,
	printHelp func(),
) error

CmdPrips is the common core logic for the prips command.

func CmdRandIP

func CmdRandIP(f CmdRandIPFlags, args []string, printHelp func()) error

func CmdRange2CIDR

func CmdRange2CIDR(
	f CmdRange2CIDRFlags,
	args []string,
	printHelp func(),
) error

CmdRange2CIDR is the common core logic for the range2cidr command.

func CmdRange2IP

func CmdRange2IP(f CmdRange2IPFlags, args []string, printHelp func()) error

func CmdSplitCIDR

func CmdSplitCIDR(
	f CmdSplitCIDRFlags,
	args []string,
	printHelp func(),
) error

CmdSplitCIDR is the common core logic for the splitcidr command.

func CmdToolAggregate

func CmdToolAggregate(
	f CmdToolAggregateFlags,
	args []string,
	printHelp func(),
) error

CmdToolAggregate is the common core logic for aggregating IPs, IP ranges and CIDRs.

func CmdToolIP2n

func CmdToolIP2n(f CmdToolIP2nFlags, args []string, printHelp func()) error

CmdToolIP2n converts an IP address to a number

func CmdToolIsGlobalUnicast

func CmdToolIsGlobalUnicast(
	f CmdToolIsGlobalUnicastFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsInterfaceLocalMulticast

func CmdToolIsInterfaceLocalMulticast(
	f CmdToolIsInterfaceLocalMulticastFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsLinkLocalMulticast

func CmdToolIsLinkLocalMulticast(
	f CmdToolIsLinkLocalMulticastFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsLinkLocalUnicast

func CmdToolIsLinkLocalUnicast(
	f CmdToolIsLinkLocalUnicastFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsLoopback

func CmdToolIsLoopback(
	f CmdToolIsLoopbackFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsMulticast

func CmdToolIsMulticast(
	f CmdToolIsMulticastFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsOneIp

func CmdToolIsOneIp(f CmdToolIsOneIpFlags, args []string, printHelp func()) error

func CmdToolIsUnspecified

func CmdToolIsUnspecified(
	f CmdToolIsUnspecifiedFlags,
	args []string,
	printHelp func(),
) error

func CmdToolIsV4

func CmdToolIsV4(
	f CmdToolIsV4Flags,
	args []string,
	printHelp func(),
) error

func CmdToolIsV4In6

func CmdToolIsV4In6(f CmdToolIsV4In6Flags, args []string, printHelp func()) error

CmdToolIsV4In6 checks if given ip is an IPv4-mapped IPv6 address.

func CmdToolIsV6

func CmdToolIsV6(
	f CmdToolIsV6Flags,
	args []string,
	printHelp func(),
) error

func CmdToolIsValid

func CmdToolIsValid(f CmdToolIsValidFlags, args []string, printHelp func()) error

CmdToolIsValid converts a number to an IP address

func CmdToolLower

func CmdToolLower(
	f CmdToolLowerFlags,
	args []string,
	printHelp func(),
) error

func CmdToolN2IP

func CmdToolN2IP(f CmdToolN2IPFlags, args []string, printHelp func()) error

CmdToolN2IP converts a number to an IP address

func CmdToolN2IP6

func CmdToolN2IP6(f CmdToolN2IP6Flags, args []string, printHelp func()) error

CmdToolN2IP6 converts a number to an IPv6 address

func CmdToolNext

func CmdToolNext(
	f CmdToolNextFlags,
	args []string,
	printHelp func(),
) error

func CmdToolPrefixAddr

func CmdToolPrefixAddr(f CmdToolPrefixAddrFlags, args []string, printHelp func()) error

func CmdToolPrefixBits

func CmdToolPrefixBits(f CmdToolPrefixBitsFlags, args []string, printHelp func()) error

func CmdToolPrefixIsValid

func CmdToolPrefixIsValid(f CmdToolPrefixIsValidFlags, args []string, printHelp func()) error

func CmdToolPrefixMasked

func CmdToolPrefixMasked(f CmdToolPrefixMaskedFlags, args []string, printHelp func()) error

func CmdToolPrev

func CmdToolPrev(
	f CmdToolPrevFlags,
	args []string,
	printHelp func(),
) error

func CmdToolUnmap

func CmdToolUnmap(f CmdToolUnmapFlags, args []string, printHelp func()) error

CmdToolUnmap converts a number to an IP address

func CmdToolUpper

func CmdToolUpper(
	f CmdToolUpperFlags,
	args []string,
	printHelp func(),
) error

func EvaluatePostfix

func EvaluatePostfix(postfix []string) (*big.Float, error)

EvaluatePostfix Function to evaluate postfix expression using a stack based algorithm

func HelpDetailed

func HelpDetailed(detailedHelp string, printHelpDefault func()) error

func InfixToPostfix

func InfixToPostfix(infix []string) []string

InfixToPostfix Function to convert infix expression to postfix expression using a stack based algorithm

func IsCIDRIPv4

func IsCIDRIPv4(ipnet *net.IPNet) bool

func IsCIDRIPv6

func IsCIDRIPv6(ipnet *net.IPNet) bool

func IsIPv4

func IsIPv4(ip net.IP) bool

func IsIPv6

func IsIPv6(ip net.IP) bool

func IsInvalidInfix

func IsInvalidInfix(expression string) bool

IsInvalidInfix Function to check if infix expression is valid

func TokenizeInfix

func TokenizeInfix(infix string) ([]string, error)

TokenizeInfix Function to tokenize infix expression

Types

type CmdASNBulkFlags

type CmdASNBulkFlags struct {
	Token string

	Field []string

	Yaml bool
	// contains filtered or unexported fields
}

CmdASNBulkFlags are flags expected by CmdASNBulk

func (*CmdASNBulkFlags) Init

func (f *CmdASNBulkFlags) Init()

Init initializes the common flags available to CmdASNBulk with sensible defaults. pflag.Parse() must be called to actually use the final flag values.

type CmdCIDR2IPFlags

type CmdCIDR2IPFlags struct {
	Help bool
}

CmdCIDR2IPFlags are flags expected by CmdCIDR2IP.

func (*CmdCIDR2IPFlags) Init

func (f *CmdCIDR2IPFlags) Init()

Init initializes the common flags available to CmdCIDR2IP with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdCIDR2RangeFlags

type CmdCIDR2RangeFlags struct {
	Help bool
}

CmdCIDR2RangeFlags are flags expected by CmdCIDR2Range.

func (*CmdCIDR2RangeFlags) Init

func (f *CmdCIDR2RangeFlags) Init()

Init initializes the common flags available to CmdCIDR2Range with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdCalcFlags

type CmdCalcFlags struct {
	Help    bool
	NoColor bool
}

CmdCalcFlags are flags expected by CmdCalc

func (*CmdCalcFlags) Init

func (f *CmdCalcFlags) Init()

Init initializes the common flags available to CmdCalc with sensible

type CmdGrepDomainFlags

type CmdGrepDomainFlags struct {
	OnlyMatching bool
	NoFilename   bool
	NoRecurse    bool
	Help         bool
	NoColor      bool
	ExcludePuny  bool
}

func (*CmdGrepDomainFlags) Init

func (f *CmdGrepDomainFlags) Init()

type CmdGrepIPFlags

type CmdGrepIPFlags struct {
	OnlyMatching  bool
	IncludeCIDRs  bool
	IncludeRanges bool
	CIDRsOnly     bool
	RangesOnly    bool
	NoFilename    bool
	NoRecurse     bool
	Help          bool
	NoColor       bool
	V4            bool
	V6            bool
	ExclRes       bool
}

CmdGrepIPFlags are flags expected by CmdGrepIP.

func (*CmdGrepIPFlags) Init

func (f *CmdGrepIPFlags) Init()

Init initializes the common flags available to CmdGrepIP with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdMatchIPFlags

type CmdMatchIPFlags struct {
	Expression []string
	Help       bool
}

func (*CmdMatchIPFlags) Init

func (f *CmdMatchIPFlags) Init()

type CmdPripsFlags

type CmdPripsFlags struct {
	Help bool
}

CmdPripsFlags are flags expected by CmdPrips.

func (*CmdPripsFlags) Init

func (f *CmdPripsFlags) Init()

Init initializes the common flags available to CmdPrips with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdRandIPFlags

type CmdRandIPFlags struct {
	Help       bool
	N          int
	IPv4       bool
	IPv6       bool
	ExcludeRes bool
	Unique     bool
	StartIP    string
	EndIP      string
}

CmdRandIPFlags are flags expected by CmdRandIP.

func (*CmdRandIPFlags) Init

func (f *CmdRandIPFlags) Init()

Init initializes the common flags available to CmdRandIP with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdRange2CIDRFlags

type CmdRange2CIDRFlags struct {
	Help bool
}

CmdRange2CIDRFlags are flags expected by CmdRange2CIDR.

func (*CmdRange2CIDRFlags) Init

func (f *CmdRange2CIDRFlags) Init()

Init initializes the common flags available to CmdRange2CIDR with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdRange2IPFlags

type CmdRange2IPFlags struct {
	Help bool
}

CmdRange2IPFlags are flags expected by CmdRange2IP.

func (*CmdRange2IPFlags) Init

func (f *CmdRange2IPFlags) Init()

Init initializes the common flags available to CmdRange2IP with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdSplitCIDRFlags

type CmdSplitCIDRFlags struct {
	Help bool
}

func (*CmdSplitCIDRFlags) Init

func (f *CmdSplitCIDRFlags) Init()

Init initializes the common flags available to CmdSplitCIDR with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdToolAggregateFlags

type CmdToolAggregateFlags struct {
	Help  bool
	Quiet bool
}

CmdToolAggregateFlags are flags expected by CmdToolAggregate.

func (*CmdToolAggregateFlags) Init

func (f *CmdToolAggregateFlags) Init()

Init initializes the common flags available to CmdToolAggregate with sensible defaults.

pflag.Parse() must be called to actually use the final flag values.

type CmdToolIP2nFlags

type CmdToolIP2nFlags struct {
	Help bool
}

CmdToolIP2nFlags are flags expected by CmdToolIP2n

func (*CmdToolIP2nFlags) Init

func (f *CmdToolIP2nFlags) Init()

Init initializes the common flags available to CmdToolIP2n with sensible

type CmdToolIsGlobalUnicastFlags

type CmdToolIsGlobalUnicastFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsGlobalUnicastFlags) Init

func (f *CmdToolIsGlobalUnicastFlags) Init()

type CmdToolIsInterfaceLocalMulticastFlags

type CmdToolIsInterfaceLocalMulticastFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsInterfaceLocalMulticastFlags) Init

type CmdToolIsLinkLocalMulticastFlags

type CmdToolIsLinkLocalMulticastFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsLinkLocalMulticastFlags) Init

type CmdToolIsLinkLocalUnicastFlags

type CmdToolIsLinkLocalUnicastFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsLinkLocalUnicastFlags) Init

type CmdToolIsLoopbackFlags

type CmdToolIsLoopbackFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsLoopbackFlags) Init

func (f *CmdToolIsLoopbackFlags) Init()

type CmdToolIsMulticastFlags

type CmdToolIsMulticastFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsMulticastFlags) Init

func (f *CmdToolIsMulticastFlags) Init()

type CmdToolIsOneIpFlags

type CmdToolIsOneIpFlags struct {
	Help bool
}

CmdToolIsOneIpFlags are flags expected by CmdToolIP2n

func (*CmdToolIsOneIpFlags) Init

func (f *CmdToolIsOneIpFlags) Init()

Init initializes the common flags available to CmdToolIsOneIp with sensible

type CmdToolIsUnspecifiedFlags

type CmdToolIsUnspecifiedFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsUnspecifiedFlags) Init

func (f *CmdToolIsUnspecifiedFlags) Init()

type CmdToolIsV4Flags

type CmdToolIsV4Flags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsV4Flags) Init

func (f *CmdToolIsV4Flags) Init()

type CmdToolIsV4In6Flags

type CmdToolIsV4In6Flags struct {
	Help bool
}

CmdToolIsV4In6Flags are flags expected by CmdToolIsV4In6

func (*CmdToolIsV4In6Flags) Init

func (f *CmdToolIsV4In6Flags) Init()

Init initializes the common flags available to CmdToolIsV4In6 with sensible

type CmdToolIsV6Flags

type CmdToolIsV6Flags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolIsV6Flags) Init

func (f *CmdToolIsV6Flags) Init()

type CmdToolIsValidFlags

type CmdToolIsValidFlags struct {
	Help bool
	// contains filtered or unexported fields
}

CmdToolIsValidFlags are flags expected by CmdToolIsValid

func (*CmdToolIsValidFlags) Init

func (f *CmdToolIsValidFlags) Init()

Init initializes the common flags available to CmdToolIsValid with sensible

type CmdToolLowerFlags

type CmdToolLowerFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolLowerFlags) Init

func (f *CmdToolLowerFlags) Init()

type CmdToolN2IP6Flags

type CmdToolN2IP6Flags struct {
	Help bool
}

CmdToolN2IP6Flags are flags expected by CmdToolN2IP6

func (*CmdToolN2IP6Flags) Init

func (f *CmdToolN2IP6Flags) Init()

Init initializes the common flags available to CmdToolN2IP6 with sensible

type CmdToolN2IPFlags

type CmdToolN2IPFlags struct {
	Help bool
	// contains filtered or unexported fields
}

CmdToolN2IPFlags are flags expected by CmdToolN2IP

func (*CmdToolN2IPFlags) Init

func (f *CmdToolN2IPFlags) Init()

Init initializes the common flags available to CmdToolN2IP with sensible

type CmdToolNextFlags

type CmdToolNextFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolNextFlags) Init

func (f *CmdToolNextFlags) Init()

type CmdToolPrefixAddrFlags

type CmdToolPrefixAddrFlags struct {
	Help bool
}

func (*CmdToolPrefixAddrFlags) Init

func (f *CmdToolPrefixAddrFlags) Init()

type CmdToolPrefixBitsFlags

type CmdToolPrefixBitsFlags struct {
	Help bool
}

func (*CmdToolPrefixBitsFlags) Init

func (f *CmdToolPrefixBitsFlags) Init()

type CmdToolPrefixIsValidFlags

type CmdToolPrefixIsValidFlags struct {
	Help bool
}

func (*CmdToolPrefixIsValidFlags) Init

func (f *CmdToolPrefixIsValidFlags) Init()

type CmdToolPrefixMaskedFlags

type CmdToolPrefixMaskedFlags struct {
	Help bool
}

func (*CmdToolPrefixMaskedFlags) Init

func (f *CmdToolPrefixMaskedFlags) Init()

type CmdToolPrevFlags

type CmdToolPrevFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolPrevFlags) Init

func (f *CmdToolPrevFlags) Init()

type CmdToolUnmapFlags

type CmdToolUnmapFlags struct {
	Help bool
}

CmdToolUnmapFlags are flags expected by CmdToolUnmap

func (*CmdToolUnmapFlags) Init

func (f *CmdToolUnmapFlags) Init()

Init initializes the common flags available to CmdToolUnmap with sensible

type CmdToolUpperFlags

type CmdToolUpperFlags struct {
	Help  bool
	Quiet bool
}

func (*CmdToolUpperFlags) Init

func (f *CmdToolUpperFlags) Init()

type Stack

type Stack []string

Stack represents a stack data structure that holds a collection of strings. The elements in the stack are managed using the Last-In-First-Out (LIFO) principle, which means that the last element added to the stack will be the first one to be removed.

func (*Stack) IsEmpty

func (st *Stack) IsEmpty() bool

IsEmpty checks if the stack is empty. It returns true if the stack contains no elements (i.e., it is empty), and false otherwise.

func (*Stack) Pop

func (st *Stack) Pop() (string, bool)

Pop removes the top element from the stack and returns it. If the stack is empty, it returns an empty string and true indicating that the stack is empty. Otherwise, it returns the top element of the stack and false. The stack is modified in-place by removing the top element.

func (*Stack) Push

func (st *Stack) Push(str string)

Push adds a new value onto the stack. The new value (given as a string) is appended to the top of the stack, effectively making it the new top element.

type SubnetPair

type SubnetPair struct {
	Raw    string
	Parsed []net.IPNet
}

Directories

Path Synopsis
install
Package install provide installation functions of command completion.
Package install provide installation functions of command completion.
predict
Package predict provides helper functions for completion predictors.
Package predict provides helper functions for completion predictors.

Jump to

Keyboard shortcuts

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