├── cmd ├── version.txt ├── root.go ├── list_test.go ├── scan_test.go ├── list.go ├── shell.go ├── scan.go ├── shell_test.go ├── lookup.go └── lookup_test.go ├── .gitignore ├── main.go ├── scripts ├── clean.sh ├── generate_test_coverage_report.sh ├── doc_gen.go ├── install.sh └── build.sh ├── internal ├── spinner │ └── spinner.go ├── test │ ├── hooks.go │ └── root.go ├── usage │ └── fatal.go ├── resolve │ ├── private.go │ ├── private_test.go │ ├── lookup_test.go │ └── lookup.go ├── encoder │ ├── encoder.go │ └── encoder_test.go ├── scanner │ ├── scanner_test.go │ └── scanner.go ├── shell │ ├── dialer.go │ ├── dialer_test.go │ ├── server_test.go │ └── server.go └── list │ ├── list_test.go │ └── list.go ├── docs ├── nw.md ├── nw_shell_dial.md ├── nw_list.md ├── nw_lookup_ip.md ├── nw_shell_serve.md ├── nw_lookup_hostname.md ├── nw_lookup_nameservers.md ├── nw_lookup_isp.md ├── nw_lookup_network.md ├── nw_shell.md ├── nw_scan.md └── nw_lookup.md ├── .github └── workflows │ └── release.yml ├── Makefile ├── README.md ├── .goreleaser.yml ├── LICENSE ├── go.mod └── go.sum /cmd/version.txt: -------------------------------------------------------------------------------- 1 | v4.0.1 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | coverage.out 3 | vendor/ -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/fuskovic/nw/v4/cmd" 4 | 5 | func main() { 6 | cmd.Root.Execute() 7 | } 8 | -------------------------------------------------------------------------------- /scripts/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "cleaning bin" 4 | rm -rf $(git rev-parse --show-toplevel)/bin > /dev/null 5 | if [ $? -ne 0 ]; then 6 | echo "no binaries to delete" 7 | fi -------------------------------------------------------------------------------- /internal/spinner/spinner.go: -------------------------------------------------------------------------------- 1 | package spinner 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/briandowns/spinner" 7 | ) 8 | 9 | var s = spinner.New(spinner.CharSets[36], 50*time.Millisecond) 10 | 11 | func Start() { s.Start() } 12 | func Stop() { s.Stop() } 13 | -------------------------------------------------------------------------------- /scripts/generate_test_coverage_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "***** GENERATING COVERAGE REPORT *****" 4 | 5 | go test -coverprofile coverage.out ./... 6 | 7 | if [ $? -ne 0 ]; then 8 | echo "tests failing" 9 | echo "coverage report not generated" 10 | exit 1 11 | fi 12 | 13 | if [ "$1" = "headless" ]; then 14 | echo "***** CHECKING COVERAGE *****" 15 | go tool cover -func coverage.out 16 | else 17 | echo "***** SERVING HTML COVERAGE DIFF... *****" 18 | go tool cover -html coverage.out 19 | fi 20 | 21 | rm coverage.out -------------------------------------------------------------------------------- /internal/test/hooks.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "os/exec" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | // WithNw is a pre-test hook that asserts the nw binary is globally installed before running the test. 11 | // It's intended to be used in the cmd/nw pkg. 12 | func WithNw(t *testing.T, name string, fn func(t *testing.T)) { 13 | t.Helper() 14 | t.Run(name, func(t *testing.T) { 15 | // make sure nw is installed 16 | cmd := exec.Command("which", "nw") 17 | require.NoError(t, cmd.Run(), "nw not installed") 18 | fn(t) 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /internal/test/root.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "os/exec" 5 | "strings" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | // ProjectRoot is a utility function for returning root path of the nw source code on this machine. 12 | // It's primary purpose is to help construct absolute paths needed by tests. 13 | func ProjectRoot(t *testing.T) string { 14 | t.Helper() 15 | output, err := exec.Command("git", "rev-parse", "--show-toplevel").CombinedOutput() 16 | require.NoError(t, err) 17 | return strings.Replace(string(output), "\n", "", 1) 18 | } 19 | -------------------------------------------------------------------------------- /internal/usage/fatal.go: -------------------------------------------------------------------------------- 1 | package usage 2 | 3 | import ( 4 | "log" 5 | "os" 6 | 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // Fatal prints the usage for the flagset and the args before returning an exit code 1. 11 | func Fatal(cmd *cobra.Command, args ...any) { 12 | log.Print(args...) 13 | _ = cmd.Usage() 14 | os.Exit(1) 15 | } 16 | 17 | // Fatalf prints the usage for the flagset and the formatted args before returning an exit code 1. 18 | func Fatalf(cmd *cobra.Command, format string, args ...any) { 19 | log.Printf(format, args...) 20 | _ = cmd.Usage() 21 | os.Exit(1) 22 | } 23 | -------------------------------------------------------------------------------- /scripts/doc_gen.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os/exec" 6 | "path" 7 | "strings" 8 | 9 | "github.com/fuskovic/nw/v4/cmd" 10 | "github.com/spf13/cobra/doc" 11 | ) 12 | 13 | var projectRoot string 14 | 15 | func init() { 16 | output, _ := exec.Command("git", "rev-parse", "--show-toplevel").CombinedOutput() 17 | projectRoot = strings.Replace(string(output), "\n", "", 1) 18 | } 19 | 20 | func main() { 21 | if err := doc.GenMarkdownTree(cmd.Root, path.Join(projectRoot, "docs")); err != nil { 22 | log.Fatalf("gen markdown tree: %v\n", err) 23 | } 24 | log.Println("docs successfully updated") 25 | } 26 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -f $(which nw) > /dev/null 4 | 5 | if [[ -z "$GOBIN" ]]; then 6 | echo "GOBIN unset" 7 | echo "add the following lines to your shells config file" 8 | echo "export GOPATH=\$HOME/go" 9 | echo "export GOBIN=\$GOPATH/bin" 10 | echo "export PATH=\$PATH:\$GOBIN" 11 | exit 1 12 | fi 13 | 14 | echo "installing" 15 | PROJECT_ROOT=$(git rev-parse --show-toplevel) 16 | go install $PROJECT_ROOT 17 | if [ $? -ne 0 ]; then 18 | echo "failed to compile nw" 19 | exit 1 20 | fi 21 | 22 | nw -v 23 | if [ $? -ne 0 ]; then 24 | echo "failed to validate nw installation" 25 | exit 1 26 | fi -------------------------------------------------------------------------------- /docs/nw.md: -------------------------------------------------------------------------------- 1 | ## nw 2 | 3 | A simple networking utility. 4 | 5 | ``` 6 | nw [flags] 7 | ``` 8 | 9 | ### Options 10 | 11 | ``` 12 | -h, --help help for nw 13 | -o, --output string Output format. Supported values include json and yaml. 14 | -v, --version Print installed version. 15 | ``` 16 | 17 | ### SEE ALSO 18 | 19 | * [nw list](nw_list.md) - List information on connected network devices. 20 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 21 | * [nw scan](nw_scan.md) - Scan hosts for open ports. 22 | * [nw shell](nw_shell.md) - Serve and establish connections with remote shells. 23 | 24 | ###### Auto generated by spf13/cobra on 14-Dec-2025 25 | -------------------------------------------------------------------------------- /docs/nw_shell_dial.md: -------------------------------------------------------------------------------- 1 | ## nw shell dial 2 | 3 | Dial a shell server. 4 | 5 | ``` 6 | nw shell dial [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Establish a new shell session by dialing a nw initiated shell server. 14 | 15 | nw shell dial some.remote.ip.addr:9000 16 | 17 | 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help help for dial 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -o, --output string Output format. Supported values include json and yaml. 30 | ``` 31 | 32 | ### SEE ALSO 33 | 34 | * [nw shell](nw_shell.md) - Serve and establish connections with remote shells. 35 | 36 | ###### Auto generated by spf13/cobra on 14-Dec-2025 37 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | tags: 4 | - "*" 5 | 6 | jobs: 7 | build: 8 | name: GoReleaser build 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Check out code into the Go module directory 13 | uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | 17 | - name: Set Up Go 18 | uses: actions/setup-go@v2 19 | with: 20 | go-version: '1.x' 21 | id: go 22 | 23 | - name: run GoReleaser 24 | uses: goreleaser/goreleaser-action@master 25 | with: 26 | version: latest 27 | args: release --clean -p 2 28 | env: 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | -------------------------------------------------------------------------------- /docs/nw_list.md: -------------------------------------------------------------------------------- 1 | ## nw list 2 | 3 | List information on connected network devices. 4 | 5 | ``` 6 | nw list [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # List devices on network: 14 | 15 | nw ls 16 | 17 | # List devices on network and output as json: 18 | 19 | nw ls -o json 20 | 21 | # List devices on network and output as yaml: 22 | 23 | nw ls -o yaml 24 | 25 | ``` 26 | 27 | ### Options 28 | 29 | ``` 30 | -h, --help help for list 31 | ``` 32 | 33 | ### Options inherited from parent commands 34 | 35 | ``` 36 | -o, --output string Output format. Supported values include json and yaml. 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [nw](nw.md) - A simple networking utility. 42 | 43 | ###### Auto generated by spf13/cobra on 14-Dec-2025 44 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROJECT_ROOT=$(git rev-parse --show-toplevel) 4 | rm -rf $PROJECT_ROOT/bin > /dev/null 5 | 6 | echo "compiling for OSX" 7 | go build -o $PROJECT_ROOT/bin/nw_darwin $PROJECT_ROOT/main.go 8 | if [ $? -ne 0 ]; then 9 | echo "failed to compile nw for OSX" && exit 1 10 | fi 11 | 12 | echo "compiling for linux" 13 | GOOS=linux GOARCH=amd64 go build -o $PROJECT_ROOT/bin/nw $PROJECT_ROOT/main.go 14 | if [ $? -ne 0 ]; then 15 | echo "failed to compile nw for linux" && exit 1 16 | fi 17 | 18 | echo "compiling for windows" 19 | GOOS=windows GOARCH=386 go build -o $PROJECT_ROOT/bin/nw.exe $PROJECT_ROOT/main.go 20 | if [ $? -ne 0 ]; then 21 | echo "failed to compile nw for windows" && exit 1 22 | fi 23 | 24 | echo "compiled successfully" -------------------------------------------------------------------------------- /cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | _ "embed" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | var ( 10 | //go:embed version.txt 11 | version string 12 | output string 13 | shouldOutputVersion bool 14 | ) 15 | 16 | func init() { 17 | Root.PersistentFlags().StringVarP(&output, "output", "o", output, "Output format. Supported values include json and yaml.") 18 | Root.Flags().BoolVarP(&shouldOutputVersion, "version", "v", false, "Print installed version.") 19 | } 20 | 21 | var Root = &cobra.Command{ 22 | Use: "nw", 23 | Short: "A simple networking utility.", 24 | Args: cobra.NoArgs, 25 | Run: func(cmd *cobra.Command, args []string) { 26 | if shouldOutputVersion { 27 | println(version) 28 | return 29 | } 30 | _ = cmd.Usage() 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY:clean 2 | clean: 3 | @./scripts/clean.sh 4 | 5 | .PHONY:install 6 | install: 7 | @./scripts/install.sh 8 | 9 | .PHONY: test 10 | test: 11 | @go clean -testcache && go test -v ./... 12 | 13 | .PHONY:build 14 | build: clean 15 | @./scripts/build.sh 16 | 17 | .PHONY: coverage 18 | coverage: 19 | @./scripts/generate_test_coverage_report.sh $(mode) 20 | 21 | .PHONY: badge 22 | badge: 23 | @gopherbadger -md="README.md" -png=false 24 | 25 | .PHONY:fmt 26 | fmt: 27 | @goimports -w $(shell find . -name "*.go") && echo "go files formatted" 28 | 29 | .PHONY:commit 30 | commit: fmt 31 | @git add . && git commit --amend --no-edit 32 | 33 | .PHONY: docs 34 | docs: 35 | @go run ./scripts/doc_gen.go 36 | 37 | .PHONY: refresh 38 | refresh: 39 | @GOPROXY=proxy.golang.org go list -m github.com/fuskovic/nw/v4@latest -------------------------------------------------------------------------------- /docs/nw_lookup_ip.md: -------------------------------------------------------------------------------- 1 | ## nw lookup ip 2 | 3 | Lookup the ip address of the provided hostname. 4 | 5 | ``` 6 | nw lookup ip [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup IP by hostname: 14 | 15 | nw lu ip dns.google. 16 | 17 | # Lookup IP by hostname and output as json: 18 | 19 | nw lu ip dns.google. -o json 20 | 21 | # Lookup IP by hostname and output as yaml: 22 | 23 | nw lu ip dns.google. -o yaml 24 | 25 | 26 | ``` 27 | 28 | ### Options 29 | 30 | ``` 31 | -h, --help help for ip 32 | ``` 33 | 34 | ### Options inherited from parent commands 35 | 36 | ``` 37 | -o, --output string Output format. Supported values include json and yaml. 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 43 | 44 | ###### Auto generated by spf13/cobra on 14-Dec-2025 45 | -------------------------------------------------------------------------------- /docs/nw_shell_serve.md: -------------------------------------------------------------------------------- 1 | ## nw shell serve 2 | 3 | Start a shell server. 4 | 5 | ``` 6 | nw shell serve [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Serve using the defaults(bash is the default shell and 4444 is the default port): 14 | 15 | nw shell serve 16 | 17 | # Serve a particular shell on a particular port: 18 | 19 | nw shell serve zsh -p 9000 20 | 21 | 22 | ``` 23 | 24 | ### Options 25 | 26 | ``` 27 | -h, --help help for serve 28 | -p, --port int Port to serve shell on. (default 4444) 29 | ``` 30 | 31 | ### Options inherited from parent commands 32 | 33 | ``` 34 | -o, --output string Output format. Supported values include json and yaml. 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [nw shell](nw_shell.md) - Serve and establish connections with remote shells. 40 | 41 | ###### Auto generated by spf13/cobra on 14-Dec-2025 42 | -------------------------------------------------------------------------------- /docs/nw_lookup_hostname.md: -------------------------------------------------------------------------------- 1 | ## nw lookup hostname 2 | 3 | Lookup the hostname for a provided ip address. 4 | 5 | ``` 6 | nw lookup hostname [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup hostname by IP: 14 | 15 | nw lu hn 8.8.8.8 16 | 17 | # Lookup hostname by IP and output as json: 18 | 19 | nw lu hn 8.8.8.8 -o json 20 | 21 | # Lookup hostname by IP and output as yaml: 22 | 23 | nw lu hn 8.8.8.8 -o yaml 24 | 25 | 26 | ``` 27 | 28 | ### Options 29 | 30 | ``` 31 | -h, --help help for hostname 32 | ``` 33 | 34 | ### Options inherited from parent commands 35 | 36 | ``` 37 | -o, --output string Output format. Supported values include json and yaml. 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 43 | 44 | ###### Auto generated by spf13/cobra on 14-Dec-2025 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nw 2 | 3 | [![Go Report Card](https://goreportcard.com/badge/github.com/fuskovic/nw/v4)](https://goreportcard.com/report/github.com/fuskovic/nw/v4) 4 | ![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-74%25-brightgreen.svg?longCache=true&style=flat) 5 | 6 | # Features 7 | 8 | - List devices on your LAN 9 | - Port scanning 10 | - Remote TTY 11 | - DNS lookup 12 | 13 | # Installation Methods 14 | 15 | Install globally using Go (requires Go 1.22^) 16 | 17 | go install github.com/fuskovic/nw/v4@latest 18 | 19 | Or Download a pre-compiled binary from the [releases](https://github.com/fuskovic/nw/releases) page. 20 | 21 | 22 | # Verify your installation 23 | 24 | nw -v 25 | 26 | # Documentation 27 | 28 | See [Docs](https://github.com/fuskovic/nw/blob/master/docs/nw.md) for command examples. 29 | -------------------------------------------------------------------------------- /docs/nw_lookup_nameservers.md: -------------------------------------------------------------------------------- 1 | ## nw lookup nameservers 2 | 3 | Lookup nameservers for the provided hostname. 4 | 5 | ``` 6 | nw lookup nameservers [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup nameservers by hostname: 14 | 15 | nw lu ns dns.google. 16 | 17 | # Lookup nameservers by hostname and output as json: 18 | 19 | nw lu ns dns.google. -o json 20 | 21 | # Lookup nameservers by hostname and output as yaml: 22 | 23 | nw lu ns dns.google. -o yaml 24 | 25 | ``` 26 | 27 | ### Options 28 | 29 | ``` 30 | -h, --help help for nameservers 31 | ``` 32 | 33 | ### Options inherited from parent commands 34 | 35 | ``` 36 | -o, --output string Output format. Supported values include json and yaml. 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 42 | 43 | ###### Auto generated by spf13/cobra on 14-Dec-2025 44 | -------------------------------------------------------------------------------- /docs/nw_lookup_isp.md: -------------------------------------------------------------------------------- 1 | ## nw lookup isp 2 | 3 | Lookup the internet service provider of a remote host. 4 | 5 | ``` 6 | nw lookup isp [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup ISP by ip or hostname: 14 | 15 | nw lu isp 8.8.8.8 16 | nw lu isp dns.google. 17 | 18 | # Lookup ISP by ip or hostname and output as json: 19 | 20 | nw lu isp 8.8.8.8 -o json 21 | nw lu isp dns.google. -o json 22 | 23 | # Lookup ISP by ip or hostname and output as yaml: 24 | 25 | nw lu isp 8.8.8.8 -o yaml 26 | nw lu isp dns.google. -o yaml 27 | 28 | ``` 29 | 30 | ### Options 31 | 32 | ``` 33 | -h, --help help for isp 34 | ``` 35 | 36 | ### Options inherited from parent commands 37 | 38 | ``` 39 | -o, --output string Output format. Supported values include json and yaml. 40 | ``` 41 | 42 | ### SEE ALSO 43 | 44 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 45 | 46 | ###### Auto generated by spf13/cobra on 14-Dec-2025 47 | -------------------------------------------------------------------------------- /docs/nw_lookup_network.md: -------------------------------------------------------------------------------- 1 | ## nw lookup network 2 | 3 | Lookup the network address of a provided host. 4 | 5 | ``` 6 | nw lookup network [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup network by ip or hostname: 14 | 15 | nw lu n 8.8.8.8 16 | nw lu n dns.google. 17 | 18 | # Lookup network by ip or hostname and output as json: 19 | 20 | nw lu n 8.8.8.8 -o json 21 | nw lu n dns.google. -o json 22 | 23 | # Lookup network by ip or hostname and output as yaml: 24 | 25 | nw lu n 8.8.8.8 -o yaml 26 | nw lu n dns.google. -o yaml 27 | 28 | 29 | ``` 30 | 31 | ### Options 32 | 33 | ``` 34 | -h, --help help for network 35 | ``` 36 | 37 | ### Options inherited from parent commands 38 | 39 | ``` 40 | -o, --output string Output format. Supported values include json and yaml. 41 | ``` 42 | 43 | ### SEE ALSO 44 | 45 | * [nw lookup](nw_lookup.md) - Lookup hostnames, IPs, ISPs, nameservers, and networks. 46 | 47 | ###### Auto generated by spf13/cobra on 14-Dec-2025 48 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | project_name: nw 2 | builds: 3 | - main: . 4 | env: 5 | - CGO_ENABLED=0 6 | goos: 7 | - darwin 8 | - linux 9 | - windows 10 | - freebsd 11 | goarch: 12 | - amd64 13 | - arm 14 | - arm64 15 | - mips 16 | goarm: 17 | - 7 18 | ignore: 19 | - goos: freebsd 20 | goarch: arm 21 | - goos: freebsd 22 | goarch: arm64 23 | - goos: freebsd 24 | goarch: mips 25 | - goos: windows 26 | goarch: arm 27 | goarm: 7 28 | - goos: windows 29 | goarch: arm64 30 | - goos: linux 31 | goarch: mips 32 | 33 | archives: 34 | - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ .Arm }}" 35 | format: tar.xz 36 | format_overrides: 37 | - goos: windows 38 | format: zip 39 | wrap_in_directory: true 40 | checksum: 41 | name_template: "{{ .ProjectName }}_{{ .Version }}--sha256_checksums.txt" 42 | release: 43 | draft: true 44 | 45 | -------------------------------------------------------------------------------- /docs/nw_shell.md: -------------------------------------------------------------------------------- 1 | ## nw shell 2 | 3 | Serve and establish connections with remote shells. 4 | 5 | ``` 6 | nw shell [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Serve using the defaults(bash is the default shell and 4444 is the default port): 14 | 15 | nw shell serve 16 | 17 | # Serve a particular shell on a particular port: 18 | 19 | nw shell serve zsh --port 9000 20 | 21 | # Establish a new shell session by dialing a nw initiated shell server. 22 | 23 | nw shell dial some.remote.ip.addr:9000 24 | 25 | 26 | ``` 27 | 28 | ### Options 29 | 30 | ``` 31 | -h, --help help for shell 32 | ``` 33 | 34 | ### Options inherited from parent commands 35 | 36 | ``` 37 | -o, --output string Output format. Supported values include json and yaml. 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [nw](nw.md) - A simple networking utility. 43 | * [nw shell dial](nw_shell_dial.md) - Dial a shell server. 44 | * [nw shell serve](nw_shell_serve.md) - Start a shell server. 45 | 46 | ###### Auto generated by spf13/cobra on 14-Dec-2025 47 | -------------------------------------------------------------------------------- /internal/resolve/private.go: -------------------------------------------------------------------------------- 1 | package resolve 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // IsPrivate checks whether or not ip is a private ip. 9 | func IsPrivate(ip *net.IP) bool { 10 | var privateIPBlocks []*net.IPNet 11 | for _, cidr := range []string{ 12 | "127.0.0.0/8", // IPv4 loopback 13 | "10.0.0.0/8", // RFC1918 14 | "172.16.0.0/12", // RFC1918 15 | "192.168.0.0/16", // RFC1918 16 | "169.254.0.0/16", // RFC3927 link-local 17 | "::1/128", // IPv6 loopback 18 | "fe80::/10", // IPv6 link-local 19 | "fc00::/7", // IPv6 unique local addr 20 | } { 21 | _, block, err := net.ParseCIDR(cidr) 22 | if err != nil { 23 | panic(fmt.Errorf("parse error on %q: %v", cidr, err)) 24 | } 25 | privateIPBlocks = append(privateIPBlocks, block) 26 | } 27 | 28 | if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() { 29 | return true 30 | } 31 | 32 | for _, block := range privateIPBlocks { 33 | if block.Contains(*ip) { 34 | return true 35 | } 36 | } 37 | return false 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Faris Huskovic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /internal/encoder/encoder.go: -------------------------------------------------------------------------------- 1 | package encoder 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | 7 | "cdr.dev/coder-cli/pkg/tablewriter" 8 | "gopkg.in/yaml.v3" 9 | ) 10 | 11 | // Encoder can encode generic objects into various output formats. 12 | type Encoder[T any] struct { 13 | w io.Writer 14 | output string 15 | } 16 | 17 | // New initializes a new Encoder. 18 | func New[T any](w io.Writer, output string) Encoder[T] { 19 | return Encoder[T]{w, output} 20 | } 21 | 22 | // Encode encodes the generic objects into the output specified during Encoder initialization. 23 | func (e *Encoder[T]) Encode(objects ...T) error { 24 | var err error 25 | switch e.output { 26 | case "json": 27 | jsonEncoder := json.NewEncoder(e.w) 28 | jsonEncoder.SetIndent("", "\t") 29 | jsonEncoder.SetEscapeHTML(true) 30 | // Don't output as json array if there is only one object 31 | if len(objects) == 1 { 32 | err = jsonEncoder.Encode(objects[0]) 33 | } else { 34 | err = jsonEncoder.Encode(objects) 35 | } 36 | case "yaml": 37 | err = yaml.NewEncoder(e.w).Encode(objects) 38 | default: 39 | err = tablewriter.WriteTable(e.w, len(objects), 40 | func(i int) any { 41 | return objects[i] 42 | }, 43 | ) 44 | } 45 | return err 46 | } 47 | -------------------------------------------------------------------------------- /internal/scanner/scanner_test.go: -------------------------------------------------------------------------------- 1 | package scanner 2 | 3 | import ( 4 | "context" 5 | "net" 6 | "strconv" 7 | "testing" 8 | 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestScanner(t *testing.T) { 13 | t.Skip("flakey") 14 | // start a listener on any available local port 15 | l, err := net.Listen("tcp", "127.0.0.1:0") 16 | require.NoError(t, err) 17 | defer l.Close() 18 | 19 | // check which port the listener is running to determine how many ports we need to scan 20 | host, portStr, err := net.SplitHostPort(l.Addr().String()) 21 | require.NoError(t, err) 22 | port, err := strconv.Atoi(portStr) 23 | require.NoError(t, err) 24 | var shouldScanAll bool 25 | if port > wellKnownPorts { 26 | shouldScanAll = true 27 | } 28 | 29 | // initialize a new scanner and scan localhost 30 | hostsToScan := []string{host} 31 | results, err := New(hostsToScan, shouldScanAll).Scan(context.Background()) 32 | require.NoError(t, err) 33 | require.Equal(t, 1, len(results)) 34 | 35 | // assert that the port the listener was started on is listed as an open port in the results 36 | var foundPort bool 37 | for _, openPort := range results[0].Ports { 38 | if openPort == port { 39 | foundPort = true 40 | } 41 | } 42 | require.True(t, foundPort) 43 | } 44 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/fuskovic/nw/v4 2 | 3 | go 1.25 4 | 5 | require ( 6 | cdr.dev/coder-cli v1.17.0 7 | github.com/ammario/ipisp v1.0.0 8 | github.com/jackpal/gateway v1.1.1 9 | github.com/spf13/cobra v1.10.2 10 | github.com/stretchr/testify v1.11.1 11 | ) 12 | 13 | require ( 14 | github.com/fatih/color v1.18.0 // indirect 15 | github.com/mattn/go-colorable v0.1.14 // indirect 16 | github.com/mattn/go-isatty v0.0.20 // indirect 17 | github.com/stretchr/objx v0.5.3 // indirect 18 | go.yaml.in/yaml/v3 v3.0.4 // indirect 19 | golang.org/x/net v0.48.0 // indirect 20 | golang.org/x/sys v0.39.0 // indirect 21 | golang.org/x/term v0.38.0 // indirect 22 | ) 23 | 24 | require ( 25 | github.com/briandowns/spinner v1.23.2 26 | github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect 27 | github.com/creack/pty v1.1.24 28 | github.com/davecgh/go-spew v1.1.1 // indirect 29 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 30 | github.com/pkg/errors v0.9.1 // indirect 31 | github.com/pmezard/go-difflib v1.0.0 // indirect 32 | github.com/russross/blackfriday/v2 v2.1.0 // indirect 33 | github.com/spf13/pflag v1.0.10 // indirect 34 | github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e 35 | golang.org/x/crypto v0.46.0 36 | gopkg.in/yaml.v3 v3.0.1 37 | ) 38 | -------------------------------------------------------------------------------- /internal/shell/dialer.go: -------------------------------------------------------------------------------- 1 | package shell 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "io" 7 | "log" 8 | "net" 9 | "os" 10 | "syscall" 11 | 12 | "golang.org/x/crypto/ssh/terminal" 13 | ) 14 | 15 | // Dial connects to the shell that it expects to be served at addr. 16 | func Dial(addr string) error { 17 | conn, err := net.Dial("tcp", addr) 18 | if err != nil { 19 | return fmt.Errorf("failed to dial %q : %w", addr, err) 20 | } 21 | defer conn.Close() 22 | 23 | oldState, err := terminal.MakeRaw(int(os.Stdin.Fd())) 24 | if err != nil { 25 | log.Printf("failed to get previous state of terminal: %s", err) 26 | } 27 | 28 | defer func() { 29 | if oldState != nil { 30 | _ = terminal.Restore(int(os.Stdin.Fd()), oldState) 31 | } 32 | }() 33 | 34 | errChan := make(chan error, 1) 35 | 36 | go func() { 37 | if _, err := io.Copy(os.Stdout, conn); err != nil && !errors.Is(err, net.ErrClosed) { 38 | errChan <- fmt.Errorf("failed to read output from connection: %s\n", err) 39 | return 40 | } 41 | errChan <- nil 42 | }() 43 | 44 | go func() { 45 | if _, err = io.Copy(conn, os.Stdin); err != nil && !errors.Is(err, syscall.EPIPE) { 46 | errChan <- fmt.Errorf("failed to write input to connection: %w", err) 47 | return 48 | } 49 | errChan <- nil 50 | }() 51 | 52 | return <-errChan 53 | } 54 | -------------------------------------------------------------------------------- /internal/resolve/private_test.go: -------------------------------------------------------------------------------- 1 | package resolve 2 | 3 | import ( 4 | "net" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | func TestPrivate(t *testing.T) { 11 | t.Parallel() 12 | for _, test := range []struct { 13 | name string 14 | ip net.IP 15 | shouldBePrivate bool 16 | }{ 17 | { 18 | name: "loopbackIpV4", 19 | ip: net.ParseIP("127.0.0.1"), 20 | shouldBePrivate: true, 21 | }, 22 | { 23 | name: "loopbackIpV6", 24 | ip: net.ParseIP("::1"), 25 | shouldBePrivate: true, 26 | }, 27 | { 28 | name: "private class A", 29 | ip: net.ParseIP("192.168.0.1"), 30 | shouldBePrivate: true, 31 | }, 32 | { 33 | name: "private class B", 34 | ip: net.ParseIP("172.16.0.1"), 35 | shouldBePrivate: true, 36 | }, 37 | { 38 | name: "private class C", 39 | ip: net.ParseIP("192.168.0.1"), 40 | shouldBePrivate: true, 41 | }, 42 | { 43 | name: "google DNS", 44 | ip: net.ParseIP("8.8.8.8"), 45 | shouldBePrivate: false, 46 | }, 47 | } { 48 | t.Run(test.name, func(t *testing.T) { 49 | t.Parallel() 50 | require.Equal(t, test.shouldBePrivate, IsPrivate(&test.ip)) 51 | }) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /cmd/list_test.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "os/exec" 6 | 7 | "testing" 8 | 9 | "github.com/fuskovic/nw/v4/internal/list" 10 | "github.com/fuskovic/nw/v4/internal/test" 11 | "github.com/stretchr/testify/require" 12 | "gopkg.in/yaml.v3" 13 | ) 14 | 15 | func TestListCommand(t *testing.T) { 16 | test.WithNw(t, "list devices output as json", func(t *testing.T) { 17 | // start the list command 18 | cmd := exec.Command("nw", "ls", "-o", "json") 19 | stdout, err := cmd.StdoutPipe() 20 | require.NoError(t, err) 21 | require.NoError(t, cmd.Start()) 22 | 23 | // assert we can unmarshal the json output as expected 24 | var devices []list.Device 25 | require.NoError(t, json.NewDecoder(stdout).Decode(&devices)) 26 | require.NoError(t, cmd.Wait()) 27 | 28 | // assert that the devices are not empty 29 | require.True(t, len(devices) > 0) 30 | }) 31 | test.WithNw(t, "list devices output as yaml", func(t *testing.T) { 32 | // start the list command 33 | cmd := exec.Command("nw", "ls", "-o", "yaml") 34 | stdout, err := cmd.StdoutPipe() 35 | require.NoError(t, err) 36 | require.NoError(t, cmd.Start()) 37 | 38 | // assert we can unmarshal the yaml output as expected 39 | var devices []list.Device 40 | require.NoError(t, yaml.NewDecoder(stdout).Decode(&devices)) 41 | require.NoError(t, cmd.Wait()) 42 | 43 | // assert that the devices are not empty 44 | require.True(t, len(devices) > 0) 45 | }) 46 | } 47 | -------------------------------------------------------------------------------- /cmd/scan_test.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "os/exec" 6 | "testing" 7 | 8 | "github.com/fuskovic/nw/v4/internal/scanner" 9 | "github.com/fuskovic/nw/v4/internal/test" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func TestScanCommand(t *testing.T) { 14 | test.WithNw(t, "output scanned devices as json", func(t *testing.T) { 15 | // start the list command 16 | cmd := exec.Command("nw", "scan", "-o", "json") 17 | stdout, err := cmd.StdoutPipe() 18 | require.NoError(t, err) 19 | require.NoError(t, cmd.Start()) 20 | 21 | // assert we can unmarshal the json output as expected 22 | var scanResults []scanner.Scan 23 | require.NoError(t, json.NewDecoder(stdout).Decode(&scanResults)) 24 | require.NoError(t, cmd.Wait()) 25 | 26 | // assert that the results are not empty 27 | require.True(t, len(scanResults) > 0) 28 | }) 29 | test.WithNw(t, "output scanned devices as yaml", func(t *testing.T) { 30 | // start the list command 31 | cmd := exec.Command("nw", "scan", "-o", "json") 32 | stdout, err := cmd.StdoutPipe() 33 | require.NoError(t, err) 34 | require.NoError(t, cmd.Start()) 35 | 36 | // assert we can unmarshal the json output as expected 37 | var scanResults []scanner.Scan 38 | require.NoError(t, json.NewDecoder(stdout).Decode(&scanResults)) 39 | require.NoError(t, cmd.Wait()) 40 | 41 | // assert that the results are not empty 42 | require.True(t, len(scanResults) > 0) 43 | }) 44 | } 45 | -------------------------------------------------------------------------------- /cmd/list.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "context" 5 | "os" 6 | "slices" 7 | 8 | "github.com/spf13/cobra" 9 | 10 | "github.com/fuskovic/nw/v4/internal/encoder" 11 | "github.com/fuskovic/nw/v4/internal/list" 12 | "github.com/fuskovic/nw/v4/internal/spinner" 13 | "github.com/fuskovic/nw/v4/internal/usage" 14 | ) 15 | 16 | func init() { 17 | Root.AddCommand(listCmd) 18 | } 19 | 20 | var listCmd = &cobra.Command{ 21 | Use: "list", 22 | Aliases: []string{"ls"}, 23 | Short: "List information on connected network devices.", 24 | Example: ` 25 | # List devices on network: 26 | 27 | nw ls 28 | 29 | # List devices on network and output as json: 30 | 31 | nw ls -o json 32 | 33 | # List devices on network and output as yaml: 34 | 35 | nw ls -o yaml 36 | `, 37 | Args: cobra.NoArgs, 38 | Run: func(cmd *cobra.Command, args []string) { 39 | ctx, cancel := context.WithCancel(context.Background()) 40 | defer cancel() 41 | 42 | spinner.Start() 43 | 44 | devices, err := list.Devices(ctx) 45 | if err != nil { 46 | usage.Fatalf(cmd, "failed to list devices: %s", err) 47 | } 48 | 49 | spinner.Stop() 50 | 51 | devices = slices.DeleteFunc(devices, 52 | func(d list.Device) bool { 53 | return d.Hostname == "N/A" && d.RemoteIP == nil 54 | }, 55 | ) 56 | 57 | enc := encoder.New[list.Device](os.Stdout, output) 58 | if err := enc.Encode(devices...); err != nil { 59 | usage.Fatalf(cmd, "failed to encode devices: %s", err) 60 | } 61 | }, 62 | } 63 | -------------------------------------------------------------------------------- /internal/list/list_test.go: -------------------------------------------------------------------------------- 1 | package list 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | func TestListDevices(t *testing.T) { 11 | t.Parallel() 12 | t.Run("ShouldPass", func(t *testing.T) { 13 | // We only check the current device exists in the list of devices 14 | // because its the only device guaranteed to be on the LAN. 15 | // Asserting against a static list of devices is not reliable because those 16 | // devices may not be on the network at anymore at any given time. 17 | t.Run("find current device in list of devices", func(t *testing.T) { 18 | t.Parallel() 19 | ctx := context.Background() 20 | currentDevice, err := getCurrentDevice(ctx) 21 | require.NoError(t, err) 22 | devices, err := Devices(ctx) 23 | require.NoError(t, err) 24 | var foundDevice bool 25 | for _, d := range devices { 26 | if d.LocalIP.String() == currentDevice.LocalIP.String() { 27 | foundDevice = true 28 | } 29 | } 30 | require.True(t, foundDevice) 31 | }) 32 | }) 33 | t.Run("ShouldFail", func(t *testing.T) { 34 | t.Run("get device using invalid ip", func(t *testing.T) { 35 | d, err := getDevice(context.Background(), "invalid") 36 | require.Nil(t, d) 37 | require.Error(t, err) 38 | }) 39 | t.Run("get hosts using invalid CIDR", func(t *testing.T) { 40 | hosts, err := getHosts(context.Background(), "invalid", nil) 41 | require.Nil(t, hosts) 42 | require.Error(t, err) 43 | }) 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /internal/shell/dialer_test.go: -------------------------------------------------------------------------------- 1 | package shell 2 | 3 | import ( 4 | "os/exec" 5 | "strconv" 6 | "strings" 7 | "testing" 8 | "time" 9 | 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func TestDialer(t *testing.T) { 14 | t.Run("ShouldFail", func(t *testing.T) { 15 | t.Run("if addr is not serving shell", func(t *testing.T) { 16 | require.Error(t, Dial("localhost:80")) 17 | }) 18 | }) 19 | t.Run("ShouldPass", func(t *testing.T) { 20 | // get the process id of the current shell 21 | getShellPid := exec.Command("bash", "-c", "echo $$") 22 | output, err := getShellPid.CombinedOutput() 23 | require.NoError(t, err) 24 | out := strings.TrimSpace(string(output)) 25 | ogPid, err := strconv.Atoi(out) 26 | require.NoError(t, err) 27 | 28 | go func() { 29 | // start the server 30 | require.NoError(t, Serve("bash", 4444)) 31 | }() 32 | 33 | // Connect to it 34 | go func() { 35 | require.NoError(t, Dial("localhost:4444")) 36 | }() 37 | 38 | // grace period to wait for connection to establish 39 | time.Sleep(time.Second) 40 | 41 | // get the process id of the new shell 42 | getShellPid = exec.Command("bash", "-c", "echo $$") 43 | output, err = getShellPid.CombinedOutput() 44 | require.NoError(t, err) 45 | out = strings.TrimSpace(string(output)) 46 | newPid, err := strconv.Atoi(out) 47 | require.NoError(t, err) 48 | 49 | // assert that the current shells process id is different than the original 50 | require.NotEqual(t, ogPid, newPid) 51 | }) 52 | } 53 | -------------------------------------------------------------------------------- /internal/shell/server_test.go: -------------------------------------------------------------------------------- 1 | package shell 2 | 3 | import ( 4 | "errors" 5 | "net" 6 | "testing" 7 | "time" 8 | 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestServer(t *testing.T) { 13 | t.Run("ShouldFail", func(t *testing.T) { 14 | t.Run("if shell is unsupported", func(t *testing.T) { 15 | expected := errors.New("shell \"unsupported\" is not supported") 16 | got := Serve("unsupported", 80) 17 | require.Error(t, got) 18 | require.Equal(t, expected, got) 19 | }) 20 | t.Run("if shell is not installed", func(t *testing.T) { 21 | expected := "shell \"fish\" does not exist on system: exec: \"fish\": executable file not found in $PATH" 22 | got := Serve("fish", 80) 23 | require.Error(t, got) 24 | require.Equal(t, expected, got.Error()) 25 | }) 26 | t.Run("if port is negative number", func(t *testing.T) { 27 | expected := "-1 is not a valid port" 28 | got := Serve("bash", -1) 29 | require.Error(t, got) 30 | require.Equal(t, expected, got.Error()) 31 | }) 32 | t.Run("if port is invalid", func(t *testing.T) { 33 | expected := "70000 is not a valid port" 34 | got := Serve("bash", 70000) 35 | require.Error(t, got) 36 | require.Equal(t, expected, got.Error()) 37 | }) 38 | }) 39 | t.Run("ShouldPass", func(t *testing.T) { 40 | go func() { 41 | // start the server 42 | require.NoError(t, Serve("bash", 1111)) 43 | }() 44 | 45 | // validate that its up 46 | conn, err := net.DialTimeout("tcp", "localhost:1111", 3*time.Second) 47 | require.NoError(t, err) 48 | 49 | // close the client connection 50 | require.NoError(t, conn.Close()) 51 | }) 52 | } 53 | -------------------------------------------------------------------------------- /internal/encoder/encoder_test.go: -------------------------------------------------------------------------------- 1 | package encoder 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestEncoder(t *testing.T) { 12 | type testObject struct { 13 | Field1 string `json:"field_1" yaml:"field_1" table:"FIELD_1"` 14 | Field2 int `json:"field_2" yaml:"field_2" table:"FIELD_2"` 15 | } 16 | 17 | for _, test := range []struct { 18 | name string 19 | output string 20 | object testObject 21 | assertExpected func(b []byte) 22 | }{ 23 | { 24 | name: "encode as json", 25 | output: "json", 26 | object: testObject{ 27 | Field1: "a", 28 | Field2: 1, 29 | }, 30 | assertExpected: func(b []byte) { 31 | o := new(testObject) 32 | require.NoError(t, json.Unmarshal(b, o)) 33 | require.Equal(t, "a", o.Field1) 34 | require.Equal(t, 1, o.Field2) 35 | }, 36 | }, 37 | { 38 | name: "encode as yaml", 39 | output: "yaml", 40 | object: testObject{ 41 | Field1: "b", 42 | Field2: 2, 43 | }, 44 | assertExpected: func(b []byte) { 45 | expected := "- field_1: b\n field_2: 2\n" 46 | require.Equal(t, expected, string(b)) 47 | }, 48 | }, 49 | { 50 | name: "encode as table", 51 | object: testObject{ 52 | Field1: "c", 53 | Field2: 3, 54 | }, 55 | assertExpected: func(b []byte) { 56 | expected := "FIELD_1 FIELD_2 \nc 3 \n" 57 | require.Equal(t, expected, string(b)) 58 | }, 59 | }, 60 | } { 61 | t.Run(test.name, func(t *testing.T) { 62 | buf := bytes.NewBuffer(nil) 63 | enc := New[testObject](buf, test.output) 64 | require.NoError(t, enc.Encode(test.object)) 65 | test.assertExpected(buf.Bytes()) 66 | }) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /docs/nw_scan.md: -------------------------------------------------------------------------------- 1 | ## nw scan 2 | 3 | Scan hosts for open ports. 4 | 5 | ``` 6 | nw scan [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Scan well-known ports(first 1024) of all devices on network: 14 | 15 | nw s 16 | 17 | # Scan well-known ports(first 1024) of all devices on network and output as json: 18 | 19 | nw s -o json 20 | 21 | # Scan well-known ports(first 1024) of all devices on network and output as yaml: 22 | 23 | nw s -o yaml 24 | 25 | # Scan all ports of all devices on network: 26 | 27 | nw s --all-ports 28 | 29 | # Scan all ports of all devices on network and output as json: 30 | 31 | nw s -o json --all-ports 32 | 33 | # Scan all ports of all devices on network and output as yaml: 34 | 35 | nw s -o yaml --all-ports 36 | 37 | # Scan well-known ports(first 1024) of single host: 38 | 39 | nw s localhost 40 | 41 | # Scan well-known ports(first 1024) of single host and output as json: 42 | 43 | nw s localhost -o json 44 | 45 | # Scan well-known ports(first 1024) of single host and output as yaml: 46 | 47 | nw s localhost -o yaml 48 | 49 | # Scan all ports of single host: 50 | 51 | nw s localhost --all-ports 52 | 53 | # Scan all ports of single host and output as json: 54 | 55 | nw s localhost -o json --all-ports 56 | 57 | # Scan all ports of single host and output as yaml: 58 | 59 | nw s localhost -o yaml --all-ports 60 | 61 | 62 | ``` 63 | 64 | ### Options 65 | 66 | ``` 67 | --all-ports Scan all ports(scans first 1024 if not enabled). 68 | -h, --help help for scan 69 | ``` 70 | 71 | ### Options inherited from parent commands 72 | 73 | ``` 74 | -o, --output string Output format. Supported values include json and yaml. 75 | ``` 76 | 77 | ### SEE ALSO 78 | 79 | * [nw](nw.md) - A simple networking utility. 80 | 81 | ###### Auto generated by spf13/cobra on 14-Dec-2025 82 | -------------------------------------------------------------------------------- /cmd/shell.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "net" 5 | "runtime" 6 | "strings" 7 | 8 | "github.com/spf13/cobra" 9 | 10 | "github.com/fuskovic/nw/v4/internal/shell" 11 | "github.com/fuskovic/nw/v4/internal/usage" 12 | ) 13 | 14 | var port int 15 | 16 | func init() { 17 | serveCmd.Flags().IntVarP(&port, "port", "p", 4444, "Port to serve shell on.") 18 | shellCmd.AddCommand(serveCmd) 19 | shellCmd.AddCommand(dialCmd) 20 | Root.AddCommand(shellCmd) 21 | } 22 | 23 | var shellCmd = &cobra.Command{ 24 | Use: "shell", 25 | Short: "Serve and establish connections with remote shells.", 26 | Example: ` 27 | # Serve using the defaults(bash is the default shell and 4444 is the default port): 28 | 29 | nw shell serve 30 | 31 | # Serve a particular shell on a particular port: 32 | 33 | nw shell serve zsh --port 9000 34 | 35 | # Establish a new shell session by dialing a nw initiated shell server. 36 | 37 | nw shell dial some.remote.ip.addr:9000 38 | 39 | `, 40 | Args: cobra.NoArgs, 41 | Run: func(cmd *cobra.Command, args []string) { 42 | _ = cmd.Usage() 43 | }, 44 | } 45 | 46 | var serveCmd = &cobra.Command{ 47 | Use: "serve", 48 | Short: "Start a shell server.", 49 | Example: ` 50 | # Serve using the defaults(bash is the default shell and 4444 is the default port): 51 | 52 | nw shell serve 53 | 54 | # Serve a particular shell on a particular port: 55 | 56 | nw shell serve zsh -p 9000 57 | 58 | `, 59 | Args: cobra.MaximumNArgs(1), 60 | Run: func(cmd *cobra.Command, args []string) { 61 | if runtime.GOOS == "windows" { 62 | usage.Fatal(cmd, "this command is not supported on windows") 63 | } 64 | 65 | sh := "bash" 66 | if len(args) == 1 { 67 | sh = strings.Replace(args[0], "/bin/", "", 1) 68 | } 69 | 70 | if err := shell.Serve(sh, port); err != nil { 71 | usage.Fatalf(cmd, "unexpected server shutdown: %s\n", err) 72 | } 73 | }, 74 | } 75 | 76 | var dialCmd = &cobra.Command{ 77 | Use: "dial", 78 | Short: "Dial a shell server.", 79 | Example: ` 80 | # Establish a new shell session by dialing a nw initiated shell server. 81 | 82 | nw shell dial some.remote.ip.addr:9000 83 | 84 | `, 85 | Args: cobra.ExactArgs(1), 86 | Run: func(cmd *cobra.Command, args []string) { 87 | if _, _, err := net.SplitHostPort(args[0]); err != nil { 88 | usage.Fatalf(cmd, "invalid address: %s\n", err) 89 | } 90 | 91 | if err := shell.Dial(args[0]); err != nil { 92 | usage.Fatalf(cmd, "dialer error: %s\n", err) 93 | } 94 | }, 95 | } 96 | -------------------------------------------------------------------------------- /docs/nw_lookup.md: -------------------------------------------------------------------------------- 1 | ## nw lookup 2 | 3 | Lookup hostnames, IPs, ISPs, nameservers, and networks. 4 | 5 | ``` 6 | nw lookup [flags] 7 | ``` 8 | 9 | ### Examples 10 | 11 | ``` 12 | 13 | # Lookup hostname by IP: 14 | 15 | nw lu hn 8.8.8.8 16 | 17 | # Lookup hostname by IP and output as json: 18 | 19 | nw lu hn 8.8.8.8 -o json 20 | 21 | # Lookup hostname by IP and output as yaml: 22 | 23 | nw lu hn 8.8.8.8 -o yaml 24 | 25 | # Lookup IP by hostname: 26 | 27 | nw lu ip dns.google. 28 | 29 | # Lookup IP by hostname and output as json: 30 | 31 | nw lu ip dns.google. -o json 32 | 33 | # Lookup IP by hostname and output as yaml: 34 | 35 | nw lu ip dns.google. -o yaml 36 | 37 | # Lookup nameservers by hostname: 38 | 39 | nw lu ns dns.google. 40 | 41 | # Lookup nameservers by hostname and output as json: 42 | 43 | nw lu ns dns.google. -o json 44 | 45 | # Lookup nameservers by hostname and output as yaml: 46 | 47 | nw lu ns dns.google. -o yaml 48 | 49 | # Lookup ISP by ip or hostname: 50 | 51 | nw lu isp 8.8.8.8 52 | nw lu isp dns.google. 53 | 54 | # Lookup ISP by ip or hostname and output as json: 55 | 56 | nw lu isp 8.8.8.8 -o json 57 | nw lu isp dns.google. -o json 58 | 59 | # Lookup ISP by ip or hostname and output as yaml: 60 | 61 | nw lu isp 8.8.8.8 -o yaml 62 | nw lu isp dns.google. -o yaml 63 | 64 | # Lookup network by ip or hostname: 65 | 66 | nw lu n 8.8.8.8 67 | nw lu n dns.google. 68 | 69 | # Lookup network by ip or hostname and output as json: 70 | 71 | nw lu n 8.8.8.8 -o json 72 | nw lu n dns.google. -o json 73 | 74 | # Lookup network by ip or hostname and output as yaml: 75 | 76 | nw lu n 8.8.8.8 -o yaml 77 | nw lu n dns.google. -o yaml 78 | 79 | 80 | ``` 81 | 82 | ### Options 83 | 84 | ``` 85 | -h, --help help for lookup 86 | ``` 87 | 88 | ### Options inherited from parent commands 89 | 90 | ``` 91 | -o, --output string Output format. Supported values include json and yaml. 92 | ``` 93 | 94 | ### SEE ALSO 95 | 96 | * [nw](nw.md) - A simple networking utility. 97 | * [nw lookup hostname](nw_lookup_hostname.md) - Lookup the hostname for a provided ip address. 98 | * [nw lookup ip](nw_lookup_ip.md) - Lookup the ip address of the provided hostname. 99 | * [nw lookup isp](nw_lookup_isp.md) - Lookup the internet service provider of a remote host. 100 | * [nw lookup nameservers](nw_lookup_nameservers.md) - Lookup nameservers for the provided hostname. 101 | * [nw lookup network](nw_lookup_network.md) - Lookup the network address of a provided host. 102 | 103 | ###### Auto generated by spf13/cobra on 14-Dec-2025 104 | -------------------------------------------------------------------------------- /internal/shell/server.go: -------------------------------------------------------------------------------- 1 | package shell 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "io" 7 | "log" 8 | "net" 9 | "os" 10 | "os/exec" 11 | "os/signal" 12 | "time" 13 | 14 | "github.com/creack/pty" 15 | ) 16 | 17 | // Serve serves a shell on the designated port. 18 | func Serve(shell string, port int) error { 19 | if !isSupportedShell(shell) { 20 | return fmt.Errorf("shell %q is not supported", shell) 21 | } 22 | 23 | if _, err := exec.LookPath(shell); err != nil { 24 | return fmt.Errorf("shell %q does not exist on system: %w", shell, err) 25 | } 26 | 27 | if !isValidPort(port) { 28 | return fmt.Errorf("%d is not a valid port", port) 29 | } 30 | 31 | sigChan := make(chan os.Signal, 1) 32 | signal.Notify(sigChan, os.Interrupt) 33 | errChan := make(chan error, 1) 34 | 35 | go func() { 36 | <-sigChan 37 | println() 38 | log.Println("received interrupt signal") 39 | log.Println("shutting down") 40 | errChan <- nil 41 | }() 42 | 43 | l, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", port)) 44 | if err != nil { 45 | return fmt.Errorf("failed to listen on port %d: %w", port, err) 46 | } 47 | defer l.Close() 48 | 49 | go func() { 50 | for { 51 | proc, err := pty.Start(exec.Command(shell)) 52 | if err != nil { 53 | errChan <- fmt.Errorf("failed to start new shell process: %w", err) 54 | return 55 | } 56 | defer proc.Close() 57 | 58 | log.Printf("serving a new %s process on localhost:%d\n", shell, port) 59 | 60 | conn, err := l.Accept() 61 | if err != nil { 62 | errChan <- fmt.Errorf("failed to accept incoming connection: %w", err) 63 | return 64 | } 65 | defer conn.Close() 66 | 67 | go handleConnection(conn, proc) 68 | } 69 | }() 70 | return <-errChan 71 | } 72 | 73 | func handleConnection(conn net.Conn, proc *os.File) { 74 | defer func() { 75 | if err := conn.Close(); err != nil { 76 | log.Printf("failed to close connection for %s: %s\n", conn.RemoteAddr(), err) 77 | } 78 | 79 | if err := proc.Close(); err != nil { 80 | log.Printf("failed to kill process started by %s: %s\n", conn.RemoteAddr(), err) 81 | } 82 | }() 83 | 84 | connectedAt := time.Now().UTC() 85 | log.Printf("client %s connected at: %s\n", conn.RemoteAddr(), connectedAt) 86 | 87 | go func() { 88 | if _, err := io.Copy(proc, conn); err != nil && !errors.Is(err, net.ErrClosed) { 89 | log.Printf("failed to read from client connection: %+v\n", err) 90 | } 91 | }() 92 | 93 | if _, err := io.Copy(conn, proc); err != nil { 94 | log.Printf("failed to write output to connection: %s", err) 95 | } 96 | 97 | log.Printf("client %s disconnected after %s\n", conn.RemoteAddr(), time.Since(connectedAt)) 98 | } 99 | 100 | func isSupportedShell(targetShell string) bool { 101 | for _, sh := range []string{"bash", "zsh", "sh", "fish"} { 102 | if sh == targetShell { 103 | return true 104 | } 105 | } 106 | return false 107 | } 108 | 109 | func isValidPort(port int) bool { 110 | return port > -1 && port < 65536 111 | } 112 | -------------------------------------------------------------------------------- /cmd/scan.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "context" 5 | "net" 6 | "os" 7 | "slices" 8 | 9 | "github.com/spf13/cobra" 10 | 11 | "github.com/fuskovic/nw/v4/internal/encoder" 12 | "github.com/fuskovic/nw/v4/internal/list" 13 | "github.com/fuskovic/nw/v4/internal/resolve" 14 | "github.com/fuskovic/nw/v4/internal/scanner" 15 | "github.com/fuskovic/nw/v4/internal/spinner" 16 | "github.com/fuskovic/nw/v4/internal/usage" 17 | ) 18 | 19 | var scanAllPorts bool 20 | 21 | func init() { 22 | scanCmd.Flags().BoolVar(&scanAllPorts, "all-ports", false, "Scan all ports(scans first 1024 if not enabled).") 23 | Root.AddCommand(scanCmd) 24 | } 25 | 26 | var scanCmd = &cobra.Command{ 27 | Use: "scan", 28 | Aliases: []string{"s"}, 29 | Short: "Scan hosts for open ports.", 30 | Example: ` 31 | # Scan well-known ports(first 1024) of all devices on network: 32 | 33 | nw s 34 | 35 | # Scan well-known ports(first 1024) of all devices on network and output as json: 36 | 37 | nw s -o json 38 | 39 | # Scan well-known ports(first 1024) of all devices on network and output as yaml: 40 | 41 | nw s -o yaml 42 | 43 | # Scan all ports of all devices on network: 44 | 45 | nw s --all-ports 46 | 47 | # Scan all ports of all devices on network and output as json: 48 | 49 | nw s -o json --all-ports 50 | 51 | # Scan all ports of all devices on network and output as yaml: 52 | 53 | nw s -o yaml --all-ports 54 | 55 | # Scan well-known ports(first 1024) of single host: 56 | 57 | nw s localhost 58 | 59 | # Scan well-known ports(first 1024) of single host and output as json: 60 | 61 | nw s localhost -o json 62 | 63 | # Scan well-known ports(first 1024) of single host and output as yaml: 64 | 65 | nw s localhost -o yaml 66 | 67 | # Scan all ports of single host: 68 | 69 | nw s localhost --all-ports 70 | 71 | # Scan all ports of single host and output as json: 72 | 73 | nw s localhost -o json --all-ports 74 | 75 | # Scan all ports of single host and output as yaml: 76 | 77 | nw s localhost -o yaml --all-ports 78 | 79 | `, 80 | Args: cobra.MaximumNArgs(1), 81 | Run: func(cmd *cobra.Command, args []string) { 82 | ctx, cancel := context.WithCancel(context.Background()) 83 | defer cancel() 84 | 85 | var hosts []string 86 | if len(args) == 0 { 87 | devices, err := list.Devices(ctx) 88 | if err != nil { 89 | usage.Fatalf(cmd, "failed to list network devices: %s", err) 90 | } 91 | for i := range devices { 92 | hosts = append(hosts, devices[i].LocalIP.String()) 93 | } 94 | } else { 95 | ip := net.ParseIP(args[0]) 96 | if ip == nil { 97 | record, err := resolve.AddrByHostName(args[0]) 98 | if err != nil { 99 | usage.Fatalf(cmd, "failed to resolve ip address from hostname: %s", err) 100 | } 101 | ip = record.IP 102 | } 103 | hosts = append(hosts, ip.String()) 104 | } 105 | 106 | spinner.Start() 107 | 108 | scans, err := scanner.New(hosts, scanAllPorts).Scan(ctx) 109 | if err != nil { 110 | usage.Fatalf(cmd, "failed scan hosts: %s", err) 111 | } 112 | 113 | spinner.Stop() 114 | 115 | scans = slices.DeleteFunc(scans, 116 | func(s scanner.Scan) bool { 117 | return s.Host == "N/A" && len(s.Ports) == 0 118 | }, 119 | ) 120 | 121 | enc := encoder.New[scanner.Scan](os.Stdout, output) 122 | if err := enc.Encode(scans...); err != nil { 123 | usage.Fatalf(cmd, "failed to encode devices: %s", err) 124 | } 125 | }, 126 | } 127 | -------------------------------------------------------------------------------- /internal/resolve/lookup_test.go: -------------------------------------------------------------------------------- 1 | package resolve 2 | 3 | import ( 4 | "net" 5 | "testing" 6 | "time" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestLookup(t *testing.T) { 12 | t.Parallel() 13 | googleDNS := net.ParseIP("8.8.8.8") 14 | t.Run("ShouldPass", func(t *testing.T) { 15 | t.Parallel() 16 | t.Run("hostname by ip", func(t *testing.T) { 17 | t.Parallel() 18 | record := HostNameByIP(googleDNS) 19 | require.Equal(t, "dns.google.", record.Hostname) 20 | }) 21 | t.Run("hostnames by ip", func(t *testing.T) { 22 | t.Parallel() 23 | hostnames := HostNamesByIP(googleDNS) 24 | require.Len(t, hostnames, 1) 25 | }) 26 | t.Run("nameservers by hostname", func(t *testing.T) { 27 | t.Parallel() 28 | nameservers, err := NameServersByHostName("farishuskovic.dev") 29 | require.NoError(t, err) 30 | require.Len(t, nameservers, 4) 31 | }) 32 | t.Run("network by hostname", func(t *testing.T) { 33 | t.Parallel() 34 | expected := net.ParseIP("8.0.0.0") 35 | record, err := NetworkByHost(googleDNS.String()) 36 | require.NoError(t, err) 37 | require.Equal(t, expected.String(), record.NetworkIP.String()) 38 | }) 39 | t.Run("hostname and ip address using hostname", func(t *testing.T) { 40 | t.Parallel() 41 | expected, err := AddrByHostName("dns.google.") 42 | require.NoError(t, err) 43 | host, got, err := HostAndAddr("dns.google.") 44 | require.NoError(t, err) 45 | require.Equal(t, "dns.google.", host) 46 | require.Equal(t, expected.IP.String(), got.String()) 47 | }) 48 | t.Run("hostname and ip address using ip", func(t *testing.T) { 49 | t.Parallel() 50 | expected, err := AddrByHostName(googleDNS.String()) 51 | require.NoError(t, err) 52 | host, got, err := HostAndAddr(googleDNS.String()) 53 | require.NoError(t, err) 54 | require.Equal(t, host, "dns.google.") 55 | require.Equal(t, expected.IP.String(), got.String()) 56 | }) 57 | t.Run("internet service provider", func(t *testing.T) { 58 | t.Parallel() 59 | dec1st1992 := time.Date(1992, time.December, 1, 0, 0, 0, 0, time.UTC) 60 | _, network, err := net.ParseCIDR("8.8.8.0/24") 61 | require.NoError(t, err) 62 | expected := &InternetServiceProvider{ 63 | Name: "GOOGLE, US", 64 | IP: &googleDNS, 65 | Country: "US", 66 | Registry: "ARIN", 67 | IpRange: network, 68 | AutonomousServiceNumber: "AS15169", 69 | AllocatedAt: &dec1st1992, 70 | } 71 | isp, err := ServiceProvider(&googleDNS) 72 | require.NoError(t, err) 73 | require.Equal(t, expected, isp) 74 | }) 75 | }) 76 | t.Run("ShouldFail", func(t *testing.T) { 77 | t.Parallel() 78 | t.Run("hostname by ip if invalid ip is input", func(t *testing.T) { 79 | t.Parallel() 80 | record := HostNameByIP(net.IP("invalid")) 81 | require.Empty(t, record.Hostname) 82 | }) 83 | t.Run("hostnames by ip if invalid ip is input", func(t *testing.T) { 84 | t.Parallel() 85 | hostnames := HostNamesByIP(net.IP("invalid")) 86 | require.Nil(t, hostnames) 87 | }) 88 | t.Run("addr by hostname if hostname is invalid", func(t *testing.T) { 89 | t.Parallel() 90 | addrs, err := AddrByHostName("invalid") 91 | require.Nil(t, addrs) 92 | require.Error(t, err) 93 | }) 94 | t.Run("addr by hostname if hostname is invalid", func(t *testing.T) { 95 | t.Parallel() 96 | addrs, err := AddrByHostName("invalid") 97 | require.Nil(t, addrs) 98 | require.Error(t, err) 99 | }) 100 | }) 101 | } 102 | -------------------------------------------------------------------------------- /internal/scanner/scanner.go: -------------------------------------------------------------------------------- 1 | package scanner 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "net" 7 | "strconv" 8 | "strings" 9 | "sync" 10 | "time" 11 | 12 | goping "github.com/tatsushid/go-fastping" 13 | 14 | "github.com/fuskovic/nw/v4/internal/resolve" 15 | ) 16 | 17 | var ( 18 | wellKnownPorts = 1024 19 | allPorts = 65535 20 | ) 21 | 22 | type Scan struct { 23 | IP string `json:"ip" table:"IP"` 24 | Host string `json:"hostname" table:"HOSTNAME"` 25 | Ports []int `json:"open_ports" table:"OPEN_PORTS"` 26 | Up bool `json:"up" yaml:"up" table:"UP"` 27 | } 28 | 29 | type Scanner interface { 30 | Scan(context.Context) ([]Scan, error) 31 | } 32 | 33 | type scanner struct { 34 | sync.Mutex 35 | scans []Scan 36 | shouldScanAll bool 37 | } 38 | 39 | // NewScanner initializes a new port-scanner based on whether or not the user wants to scan all ports or just the well-known ports. 40 | func New(hosts []string, shouldScanAll bool) Scanner { 41 | var ( 42 | scans []Scan 43 | wg sync.WaitGroup 44 | mu sync.Mutex 45 | ) 46 | 47 | for _, host := range hosts { 48 | wg.Add(1) 49 | go func(ip string) { 50 | defer wg.Done() 51 | p := goping.NewPinger() 52 | _, _ = p.Network("udp") 53 | 54 | netProto := "ip4:icmp" 55 | if strings.Contains(ip, ":") { 56 | netProto = "ip6:ipv6-icmp" 57 | } 58 | 59 | addr, err := net.ResolveIPAddr(netProto, ip) 60 | if err != nil { 61 | return 62 | } 63 | 64 | p.AddIPAddr(addr) 65 | p.MaxRTT = time.Second 66 | 67 | s := Scan{IP: ip} 68 | p.OnRecv = func(addr *net.IPAddr, t time.Duration) { s.Up = true } 69 | if err := p.Run(); err != nil { 70 | return 71 | } 72 | 73 | mu.Lock() 74 | scans = append(scans, s) 75 | mu.Unlock() 76 | }(host) 77 | } 78 | wg.Wait() 79 | 80 | return &scanner{ 81 | Mutex: sync.Mutex{}, 82 | scans: scans, 83 | shouldScanAll: shouldScanAll, 84 | } 85 | } 86 | 87 | func (s *scanner) Scan(ctx context.Context) ([]Scan, error) { 88 | var wg sync.WaitGroup 89 | for _, scan := range s.scans { 90 | if scan.Up { 91 | wg.Add(1) 92 | go func(ip string) { 93 | defer wg.Done() 94 | s.scanHost(ip) 95 | }(scan.IP) 96 | } 97 | } 98 | wg.Wait() 99 | 100 | for i := range s.scans { 101 | hostname, _, err := resolve.HostAndAddr(s.scans[i].IP) 102 | if err != nil { 103 | return nil, fmt.Errorf("failed to lookup hostname by ip for %s: %w", s.scans[i].IP, err) 104 | } 105 | s.scans[i].Host = hostname 106 | } 107 | return s.scans, nil 108 | } 109 | 110 | func (s *scanner) scanHost(host string) { 111 | var wg sync.WaitGroup 112 | for _, port := range portsToScan(s.shouldScanAll) { 113 | wg.Add(1) 114 | go func(p int) { 115 | defer wg.Done() 116 | if isOpen(host, p) { 117 | s.add(host, p) 118 | } 119 | }(port) 120 | } 121 | wg.Wait() 122 | } 123 | 124 | func (s *scanner) add(ip string, port int) { 125 | s.Lock() 126 | for i := range s.scans { 127 | if s.scans[i].IP == ip { 128 | s.scans[i].Ports = append(s.scans[i].Ports, port) 129 | } 130 | } 131 | s.Unlock() 132 | } 133 | 134 | func isOpen(ip string, port int) bool { 135 | addr := net.JoinHostPort(ip, strconv.Itoa(port)) 136 | conn, err := net.DialTimeout("tcp", addr, 5*time.Second) 137 | if err != nil { 138 | return false 139 | } 140 | defer conn.Close() 141 | return true 142 | } 143 | 144 | func portsToScan(shouldScanAll bool) []int { 145 | var max int 146 | if shouldScanAll { 147 | max = allPorts 148 | } else { 149 | max = wellKnownPorts 150 | } 151 | 152 | var ports []int 153 | for p := 0; p < max; p++ { 154 | ports = append(ports, p) 155 | } 156 | return ports 157 | } 158 | -------------------------------------------------------------------------------- /cmd/shell_test.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "net" 5 | "os/exec" 6 | "strconv" 7 | "strings" 8 | "testing" 9 | "time" 10 | 11 | "github.com/fuskovic/nw/v4/internal/test" 12 | "github.com/stretchr/testify/require" 13 | ) 14 | 15 | func TestServeCommand(t *testing.T) { 16 | t.Run("ShouldFail", func(t *testing.T) { 17 | test.WithNw(t, "if shell is unsupported", func(t *testing.T) { 18 | cmd := exec.Command("nw", "shell", "serve", "unsupported") 19 | output, err := cmd.CombinedOutput() 20 | require.Error(t, err) 21 | require.Contains(t, string(output), "shell \"unsupported\" is not supported") 22 | }) 23 | test.WithNw(t, "if shell is not installed", func(t *testing.T) { 24 | cmd := exec.Command("nw", "shell", "serve", "fish") 25 | output, err := cmd.CombinedOutput() 26 | require.Error(t, err) 27 | require.Contains(t, 28 | string(output), 29 | "shell \"fish\" does not exist on system: exec: \"fish\": executable file not found in $PATH", 30 | ) 31 | }) 32 | test.WithNw(t, "if port is invalid", func(t *testing.T) { 33 | cmd := exec.Command("nw", "shell", "serve", "-p", "70000") 34 | output, err := cmd.CombinedOutput() 35 | require.Error(t, err) 36 | require.Contains(t, string(output), "not a valid port") 37 | }) 38 | }) 39 | t.Run("ShouldPass", func(t *testing.T) { 40 | test.WithNw(t, "if args are valid", func(t *testing.T) { 41 | t.Skip() 42 | cmd := exec.Command("nw", "shell", "serve", "-p", "2222") 43 | require.NoError(t, cmd.Start()) 44 | 45 | // validate that the server is up 46 | conn, err := net.DialTimeout("tcp", "localhost:2222", 3*time.Second) 47 | require.NoError(t, err) 48 | 49 | // close the client connection 50 | require.NoError(t, conn.Close()) 51 | }) 52 | }) 53 | } 54 | 55 | func TestDialCommand(t *testing.T) { 56 | t.Run("ShouldFail", func(t *testing.T) { 57 | test.WithNw(t, "if target addr is not serving shell", func(t *testing.T) { 58 | cmd := exec.Command("nw", "shell", "dial", "localhost:9000") 59 | output, err := cmd.CombinedOutput() 60 | require.Error(t, err) 61 | require.Contains(t, string(output), "connect: connection refused") 62 | }) 63 | }) 64 | t.Run("ShouldPass", func(t *testing.T) { 65 | test.WithNw(t, "if dialing active shell server with valid args", func(t *testing.T) { 66 | cmd := exec.Command("nw", "shell", "serve", "-p", "8000") 67 | require.NoError(t, cmd.Start()) 68 | 69 | // validate that the server is up 70 | conn, err := net.DialTimeout("tcp", "localhost:8000", 3*time.Second) 71 | require.NoError(t, err) 72 | 73 | // close the client connection 74 | require.NoError(t, conn.Close()) 75 | 76 | // get the process id of the current shell 77 | getShellPid := exec.Command("bash", "-c", "echo $$") 78 | output, err := getShellPid.CombinedOutput() 79 | require.NoError(t, err) 80 | out := strings.TrimSpace(string(output)) 81 | ogPid, err := strconv.Atoi(out) 82 | require.NoError(t, err) 83 | t.Logf("og_pid: %d\n", ogPid) 84 | 85 | // dial it using the dial subcommand 86 | cmd = exec.Command("nw", "shell", "dial", "localhost:8000") 87 | require.NoError(t, cmd.Start()) 88 | 89 | // grace period to wait for connection to establish 90 | time.Sleep(time.Second) 91 | 92 | // get the process id of the new shell 93 | getShellPid = exec.Command("bash", "-c", "echo $$") 94 | output, err = getShellPid.CombinedOutput() 95 | require.NoError(t, err) 96 | out = strings.TrimSpace(string(output)) 97 | remotePid, err := strconv.Atoi(out) 98 | require.NoError(t, err) 99 | t.Logf("remote_pid: %d\n", remotePid) 100 | 101 | // assert that the current shells process id is different than the original 102 | require.NotEqual(t, ogPid, remotePid) 103 | 104 | // kill the client connection by exiting the remote shell 105 | exitCmd := exec.Command("bash", "-c", "exit") 106 | require.NoError(t, exitCmd.Run()) 107 | }) 108 | }) 109 | } 110 | -------------------------------------------------------------------------------- /internal/list/list.go: -------------------------------------------------------------------------------- 1 | package list 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "io" 8 | "net" 9 | "net/http" 10 | "strings" 11 | "sync" 12 | "time" 13 | 14 | gw "github.com/jackpal/gateway" 15 | goping "github.com/tatsushid/go-fastping" 16 | 17 | "github.com/fuskovic/nw/v4/internal/resolve" 18 | ) 19 | 20 | const ( 21 | notAvailable = "N/A" 22 | icmpIpv4 = "ip4:icmp" 23 | icmpIpv6 = "ip6:ipv6-icmp" 24 | ) 25 | 26 | const ( 27 | DeviceKindUnknown Kind = "unknown" 28 | DeviceKindRouter Kind = "router" 29 | DeviceKindCurrent Kind = "current-device" 30 | DeviceKindPeer Kind = "peer" 31 | ) 32 | 33 | type Kind string 34 | 35 | type Device struct { 36 | Kind Kind `json:"kind" table:"KIND"` 37 | Hostname string `json:"hostname" table:"HOSTNAME"` 38 | LocalIP net.IP `json:"local_ip" table:"LOCAL_IP"` 39 | RemoteIP net.IP `json:"remote_ip,omitempty" table:"REMOTE_IP"` 40 | Up bool `json:"up" yaml:"up" table:"UP"` 41 | } 42 | 43 | // Devices lists all of the devices on the local network. 44 | func Devices(ctx context.Context) ([]Device, error) { 45 | cidr, err := getCIDR(ctx) 46 | if err != nil { 47 | return nil, fmt.Errorf("failed to get cidr: %w", err) 48 | } 49 | 50 | router, err := getRouter(ctx) 51 | if err != nil { 52 | return nil, fmt.Errorf("failed to get router: %w", err) 53 | } 54 | 55 | hostIPs, err := getHosts(ctx, cidr, router) 56 | if err != nil { 57 | return nil, fmt.Errorf("failed to get hosts: %w", err) 58 | } 59 | 60 | currentDevice, err := getCurrentDevice(ctx) 61 | if err != nil { 62 | return nil, fmt.Errorf("failed to get current device: %w", err) 63 | } 64 | 65 | hostIPs = removeIP(currentDevice.LocalIP.String(), hostIPs) 66 | 67 | var ( 68 | devices = []Device{*router, *currentDevice} 69 | wg = sync.WaitGroup{} 70 | mutex = sync.Mutex{} 71 | ) 72 | 73 | for _, hostIP := range dedupe(hostIPs) { 74 | wg.Add(1) 75 | go func(ip string) { 76 | defer wg.Done() 77 | 78 | device, err := getDevice(ctx, ip) 79 | if err != nil || device == nil { 80 | return 81 | } 82 | device.Up = ping(ip) 83 | 84 | mutex.Lock() 85 | devices = append(devices, *device) 86 | mutex.Unlock() 87 | }(hostIP) 88 | } 89 | wg.Wait() 90 | return devices, nil 91 | } 92 | 93 | func getDevice(_ context.Context, ip string) (*Device, error) { 94 | ipAddr := net.ParseIP(ip) 95 | if ipAddr == nil { 96 | return nil, fmt.Errorf("failed to parse ip %q", ip) 97 | } 98 | 99 | return &Device{ 100 | LocalIP: ipAddr, 101 | Hostname: resolve.Hostname(ipAddr), 102 | Kind: DeviceKindPeer, 103 | }, nil 104 | } 105 | 106 | func getCurrentDevice(_ context.Context) (*Device, error) { 107 | localIP, err := getCurrentDeviceLocalIP() 108 | if err != nil { 109 | return nil, fmt.Errorf("failed to get local ip of current device: %w", err) 110 | } 111 | 112 | remoteIP, err := getCurrentDeviceRemoteIP() 113 | if err != nil { 114 | return nil, fmt.Errorf("failed to get remote ip of current device: %w", err) 115 | } 116 | 117 | return &Device{ 118 | LocalIP: localIP, 119 | RemoteIP: remoteIP, 120 | Hostname: resolve.Hostname(localIP), 121 | Kind: DeviceKindCurrent, 122 | Up: true, 123 | }, nil 124 | } 125 | 126 | func getRouter(_ context.Context) (*Device, error) { 127 | ipAddr, err := gw.DiscoverGateway() 128 | if err != nil { 129 | return nil, fmt.Errorf("failed to discover gateway: %w", err) 130 | } 131 | 132 | return &Device{ 133 | Hostname: resolve.Hostname(ipAddr), 134 | LocalIP: ipAddr, 135 | Kind: DeviceKindRouter, 136 | Up: true, 137 | }, nil 138 | } 139 | 140 | func getCIDR(_ context.Context) (string, error) { 141 | localIP, err := getCurrentDeviceLocalIP() 142 | if err != nil { 143 | return "", fmt.Errorf("failed to get local ip: %w", err) 144 | } 145 | return fmt.Sprintf("%s/24", localIP.Mask(localIP.DefaultMask())), nil 146 | } 147 | 148 | func getHosts(_ context.Context, cidr string, router *Device) ([]string, error) { 149 | ip, network, err := net.ParseCIDR(cidr) 150 | if err != nil { 151 | return nil, fmt.Errorf("failed to parse cidr %s: %w", cidr, err) 152 | } 153 | 154 | inc := func(ip net.IP) { 155 | for j := len(ip) - 1; j >= 0; j-- { 156 | ip[j]++ 157 | if ip[j] > 0 { 158 | break 159 | } 160 | } 161 | } 162 | 163 | var ips []string 164 | for ip := ip.Mask(network.Mask); network.Contains(ip); inc(ip) { 165 | if ip.String() == router.LocalIP.String() { 166 | continue 167 | } 168 | ips = append(ips, ip.String()) 169 | } 170 | return ips[1 : len(ips)-1], nil 171 | } 172 | 173 | func getCurrentDeviceLocalIP() (net.IP, error) { 174 | c, err := net.Dial("udp", "8.8.8.8:80") 175 | if err != nil { 176 | return nil, fmt.Errorf("failed to dial google dns : %w", err) 177 | } 178 | defer c.Close() 179 | 180 | localAddr, ok := c.LocalAddr().(*net.UDPAddr) 181 | if !ok { 182 | return nil, errors.New("failed to resolve local IP") 183 | } 184 | return localAddr.IP, nil 185 | } 186 | 187 | func getCurrentDeviceRemoteIP() (net.IP, error) { 188 | r, err := http.Get("http://myexternalip.com/raw") 189 | if err != nil { 190 | return nil, err 191 | } 192 | defer r.Body.Close() 193 | 194 | b, err := io.ReadAll(r.Body) 195 | if err != nil { 196 | return nil, err 197 | } 198 | 199 | var remoteIP net.IP 200 | ipAddr := string(b) 201 | if strings.Contains(ipAddr, ":") { 202 | remoteIP = net.ParseIP(ipAddr).To16() 203 | } else { 204 | remoteIP = net.ParseIP(ipAddr).To4() 205 | } 206 | if remoteIP == nil { 207 | return nil, fmt.Errorf("failed to get resolve ip %q as ipv4", b) 208 | } 209 | return remoteIP, nil 210 | } 211 | 212 | func dedupe(hosts []string) []string { 213 | m := make(map[string]int) 214 | var filteredHosts []string 215 | for _, host := range hosts { 216 | if m[host] == 0 { 217 | m[host]++ 218 | filteredHosts = append(filteredHosts, host) 219 | continue 220 | } 221 | } 222 | return filteredHosts 223 | } 224 | 225 | func removeIP(ip string, hosts []string) []string { 226 | var filteredHosts []string 227 | for _, host := range hosts { 228 | if host == ip { 229 | continue 230 | } 231 | filteredHosts = append(filteredHosts, host) 232 | } 233 | return filteredHosts 234 | } 235 | 236 | func ping(ip string) bool { 237 | p := goping.NewPinger() 238 | p.Network("udp") 239 | 240 | netProto := icmpIpv4 241 | if strings.Contains(ip, ":") { 242 | netProto = icmpIpv6 243 | } 244 | 245 | addr, err := net.ResolveIPAddr(netProto, ip) 246 | if err != nil { 247 | return false 248 | } 249 | 250 | p.AddIPAddr(addr) 251 | p.MaxRTT = time.Second 252 | 253 | var up bool 254 | p.OnRecv = func(addr *net.IPAddr, t time.Duration) { 255 | up = true 256 | } 257 | p.Run() 258 | return up 259 | } 260 | -------------------------------------------------------------------------------- /internal/resolve/lookup.go: -------------------------------------------------------------------------------- 1 | package resolve 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | "strings" 7 | "time" 8 | 9 | "github.com/ammario/ipisp" 10 | ) 11 | 12 | // Record can be used as a common type between lookup commands 13 | // that supports json and table output. 14 | type Record struct { 15 | Hostname string `json:"hostname" yaml:"hostname" table:"HOSTNAME"` 16 | IP net.IP `json:"ip" yaml:"ip" table:"IP_ADDRESS"` 17 | } 18 | 19 | type NetworkRecord struct { 20 | Hostname string `json:"hostname" yaml:"hostname,flow" table:"HOSTNAME"` 21 | NetworkIP net.IP `json:"network" yaml:"network" table:"NETWORK"` 22 | } 23 | 24 | // InternetServiceProvider describes an internet service provider. 25 | type InternetServiceProvider struct { 26 | Name string `json:"name" table:"NAME"` 27 | IP *net.IP `json:"ip_address" table:"IP"` 28 | Country string `json:"country" table:"COUNTRY"` 29 | Registry string `json:"registry" table:"REGISTRY"` 30 | IpRange *net.IPNet `json:"ip_range" table:"IP_RANGE"` 31 | AutonomousServiceNumber string `json:"autonomous_service_number" table:"ASN"` 32 | AllocatedAt *time.Time `json:"allocated_at" table:"ALLOCATED_AT"` 33 | } 34 | 35 | // NameServer is used in place of the standard library object to support table writes. 36 | type NameServer struct { 37 | IP net.IP `json:"ip" table:"IP"` 38 | Host string `json:"nameserver" table:"Nameserver"` 39 | } 40 | 41 | const notAvailable = "N/A" 42 | 43 | func Hostname(ip net.IP) string { 44 | record := HostNameByIP(ip) 45 | if record.Hostname == "" { 46 | return notAvailable 47 | } 48 | return record.Hostname 49 | } 50 | 51 | // HostNameByIP returns the hostname for the provided ip address. 52 | func HostNameByIP(ip net.IP) *Record { 53 | var hostname string 54 | hostnames := HostNamesByIP(ip) 55 | if len(hostnames) > 0 { 56 | hostname = hostnames[0] 57 | } 58 | return &Record{ 59 | IP: ip, 60 | Hostname: hostname, 61 | } 62 | } 63 | 64 | // HostNamesByIP returns all hostnames found for the provided ip address. 65 | func HostNamesByIP(ip net.IP) []string { 66 | hostnames, _ := net.LookupAddr(ip.String()) 67 | return hostnames 68 | } 69 | 70 | // AddrByHostName resolves the ip address of the provided hostname. 71 | func AddrByHostName(hostname string) (*Record, error) { 72 | ipAddrs, err := AddrsByHostName(hostname) 73 | if err != nil { 74 | return nil, err 75 | } 76 | 77 | if len(ipAddrs) == 0 { 78 | return nil, fmt.Errorf("no addresses found for hostname %q", hostname) 79 | } 80 | 81 | var ipAddr net.IP 82 | if strings.Contains(string(*ipAddrs[0]), ":") { 83 | ipAddr = ipAddrs[0].To16() 84 | } else { 85 | ipAddr = ipAddrs[0].To4() 86 | } 87 | 88 | return &Record{ 89 | Hostname: hostname, 90 | IP: ipAddr, 91 | }, err 92 | } 93 | 94 | // AddrsByHostName returns all ip addresses found for the provided hostname. 95 | func AddrsByHostName(hostname string) ([]*net.IP, error) { 96 | addrs, err := net.LookupHost(hostname) 97 | if err != nil { 98 | return nil, fmt.Errorf("failed to look up ip addresses for hostname %q: %v", hostname, err) 99 | } 100 | 101 | if len(addrs) == 0 { 102 | return nil, fmt.Errorf("no ip addresses found for hostname %q", hostname) 103 | } 104 | 105 | var ipAddrs []*net.IP 106 | 107 | for _, a := range addrs { 108 | ipAddr := net.ParseIP(a).To4() 109 | if ipAddr == nil { 110 | continue 111 | } 112 | ipAddrs = append(ipAddrs, &ipAddr) 113 | } 114 | return ipAddrs, nil 115 | } 116 | 117 | // NameServersByHostName looks up all nameservers for the provided hostname. 118 | func NameServersByHostName(hostname string) ([]NameServer, error) { 119 | internalNameServers, err := net.LookupNS(stripHostname(hostname)) 120 | if err != nil { 121 | return nil, fmt.Errorf("failed to look up name server for hostname %q : %v", hostname, err) 122 | } 123 | if len(internalNameServers) == 0 { 124 | return nil, fmt.Errorf("no name servers found for hostname %q", hostname) 125 | } 126 | var nameServers []NameServer 127 | for _, ns := range internalNameServers { 128 | record, err := AddrByHostName(ns.Host) 129 | if err != nil { 130 | return nil, fmt.Errorf("failed to get ip by hostname %q: %w", ns.Host, err) 131 | } 132 | nameServers = append(nameServers, 133 | NameServer{ 134 | IP: record.IP.To4(), 135 | Host: ns.Host, 136 | }, 137 | ) 138 | } 139 | return nameServers, nil 140 | } 141 | 142 | // NetworkByHost returns the network address for the provided hostname. 143 | func NetworkByHost(host string) (*NetworkRecord, error) { 144 | var hostname string 145 | ipAddr := net.ParseIP(host) 146 | if ipAddr == nil { 147 | hostname = host 148 | record, err := AddrByHostName(host) 149 | if err != nil { 150 | return nil, fmt.Errorf("%q is an invalild host: %v", host, err) 151 | } 152 | ipAddr = record.IP 153 | } else { 154 | hostname = Hostname(ipAddr) 155 | } 156 | 157 | network := ipAddr.Mask(ipAddr.DefaultMask()) 158 | if network == nil { 159 | return nil, fmt.Errorf("failed to get network address of host %q", ipAddr.String()) 160 | } 161 | 162 | return &NetworkRecord{ 163 | Hostname: hostname, 164 | NetworkIP: network, 165 | }, nil 166 | } 167 | 168 | // HostAndAddr returns the hostname and ip address of host whether host is an IP address or a hostname. 169 | // HostAndAddr returns a non-nil error if host is an invalid ip address or a hostname that cannot be resolved to an IP address. 170 | func HostAndAddr(host string) (string, *net.IP, error) { 171 | var hostname string 172 | 173 | ip := net.ParseIP(host) 174 | if ip == nil { 175 | hostname = host 176 | record, err := AddrByHostName(hostname) 177 | if err != nil { 178 | return "", nil, fmt.Errorf("failed to get ip address by hostname %q: %w", hostname, err) 179 | } 180 | ip = record.IP 181 | } else { 182 | hostname = Hostname(ip) 183 | } 184 | return hostname, &ip, nil 185 | } 186 | 187 | // ServiceProvider returns the internet service provider information for ip. 188 | func ServiceProvider(ip *net.IP) (*InternetServiceProvider, error) { 189 | client, err := ipisp.NewDNSClient() 190 | if err != nil { 191 | return nil, fmt.Errorf("failed to initialize new dns client: %w", err) 192 | } 193 | defer client.Close() 194 | 195 | resp, err := client.LookupIP(*ip) 196 | if err != nil { 197 | return nil, err 198 | } 199 | 200 | return &InternetServiceProvider{ 201 | Name: resp.Name.Raw, 202 | IP: &resp.IP, 203 | Country: resp.Country, 204 | Registry: resp.Registry, 205 | IpRange: resp.Range, 206 | AutonomousServiceNumber: resp.ASN.String(), 207 | AllocatedAt: &resp.AllocatedAt, 208 | }, nil 209 | } 210 | 211 | func stripHostname(hostname string) string { 212 | hostname = strings.ReplaceAll(hostname, "https://", "") 213 | hostname = strings.ReplaceAll(hostname, "http://", "") 214 | hostname = strings.ReplaceAll(hostname, "www.", "") 215 | return hostname 216 | } 217 | -------------------------------------------------------------------------------- /cmd/lookup.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "net" 5 | "os" 6 | 7 | "github.com/fuskovic/nw/v4/internal/encoder" 8 | "github.com/fuskovic/nw/v4/internal/resolve" 9 | "github.com/fuskovic/nw/v4/internal/usage" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func init() { 14 | lookupCmd.AddCommand(lookupIspCmd) 15 | lookupCmd.AddCommand(lookupNameserversCmd) 16 | lookupCmd.AddCommand(lookupHostnameCmd) 17 | lookupCmd.AddCommand(lookupIpaddressCmd) 18 | lookupCmd.AddCommand(lookupNetworkCmd) 19 | Root.AddCommand(lookupCmd) 20 | } 21 | 22 | var lookupCmd = &cobra.Command{ 23 | Use: "lookup", 24 | Aliases: []string{"lu"}, 25 | SuggestFor: []string{}, 26 | Example: ` 27 | # Lookup hostname by IP: 28 | 29 | nw lu hn 8.8.8.8 30 | 31 | # Lookup hostname by IP and output as json: 32 | 33 | nw lu hn 8.8.8.8 -o json 34 | 35 | # Lookup hostname by IP and output as yaml: 36 | 37 | nw lu hn 8.8.8.8 -o yaml 38 | 39 | # Lookup IP by hostname: 40 | 41 | nw lu ip dns.google. 42 | 43 | # Lookup IP by hostname and output as json: 44 | 45 | nw lu ip dns.google. -o json 46 | 47 | # Lookup IP by hostname and output as yaml: 48 | 49 | nw lu ip dns.google. -o yaml 50 | 51 | # Lookup nameservers by hostname: 52 | 53 | nw lu ns dns.google. 54 | 55 | # Lookup nameservers by hostname and output as json: 56 | 57 | nw lu ns dns.google. -o json 58 | 59 | # Lookup nameservers by hostname and output as yaml: 60 | 61 | nw lu ns dns.google. -o yaml 62 | 63 | # Lookup ISP by ip or hostname: 64 | 65 | nw lu isp 8.8.8.8 66 | nw lu isp dns.google. 67 | 68 | # Lookup ISP by ip or hostname and output as json: 69 | 70 | nw lu isp 8.8.8.8 -o json 71 | nw lu isp dns.google. -o json 72 | 73 | # Lookup ISP by ip or hostname and output as yaml: 74 | 75 | nw lu isp 8.8.8.8 -o yaml 76 | nw lu isp dns.google. -o yaml 77 | 78 | # Lookup network by ip or hostname: 79 | 80 | nw lu n 8.8.8.8 81 | nw lu n dns.google. 82 | 83 | # Lookup network by ip or hostname and output as json: 84 | 85 | nw lu n 8.8.8.8 -o json 86 | nw lu n dns.google. -o json 87 | 88 | # Lookup network by ip or hostname and output as yaml: 89 | 90 | nw lu n 8.8.8.8 -o yaml 91 | nw lu n dns.google. -o yaml 92 | 93 | `, 94 | Short: "Lookup hostnames, IPs, ISPs, nameservers, and networks.", 95 | Run: func(cmd *cobra.Command, args []string) { 96 | _ = cmd.Usage() 97 | }, 98 | } 99 | 100 | var lookupHostnameCmd = &cobra.Command{ 101 | Use: "hostname", 102 | Short: "Lookup the hostname for a provided ip address.", 103 | Aliases: []string{"hn"}, 104 | Example: ` 105 | # Lookup hostname by IP: 106 | 107 | nw lu hn 8.8.8.8 108 | 109 | # Lookup hostname by IP and output as json: 110 | 111 | nw lu hn 8.8.8.8 -o json 112 | 113 | # Lookup hostname by IP and output as yaml: 114 | 115 | nw lu hn 8.8.8.8 -o yaml 116 | 117 | `, 118 | Args: cobra.ExactArgs(1), 119 | Run: func(cmd *cobra.Command, args []string) { 120 | ipAddr := net.ParseIP(args[0]) 121 | if ipAddr == nil { 122 | usage.Fatalf(cmd, "%q is not a valid ip address", args[0]) 123 | } 124 | enc := encoder.New[resolve.Record](os.Stdout, output) 125 | if err := enc.Encode(*resolve.HostNameByIP(ipAddr)); err != nil { 126 | usage.Fatalf(cmd, "failed to encode hostname record: %s", err) 127 | } 128 | }, 129 | } 130 | 131 | var lookupIpaddressCmd = &cobra.Command{ 132 | Use: "ip", 133 | Short: "Lookup the ip address of the provided hostname.", 134 | Example: ` 135 | # Lookup IP by hostname: 136 | 137 | nw lu ip dns.google. 138 | 139 | # Lookup IP by hostname and output as json: 140 | 141 | nw lu ip dns.google. -o json 142 | 143 | # Lookup IP by hostname and output as yaml: 144 | 145 | nw lu ip dns.google. -o yaml 146 | 147 | `, 148 | Args: cobra.ExactArgs(1), 149 | Run: func(cmd *cobra.Command, args []string) { 150 | if ip := net.ParseIP(args[0]); ip != nil { 151 | usage.Fatal(cmd, "expected a hostname not an ip address") 152 | return 153 | } 154 | 155 | record, err := resolve.AddrByHostName(args[0]) 156 | if err != nil { 157 | usage.Fatalf(cmd, "lookup failed: %s", err) 158 | } 159 | 160 | enc := encoder.New[resolve.Record](os.Stdout, output) 161 | if err := enc.Encode(*record); err != nil { 162 | usage.Fatalf(cmd, "failed to encode ip address record: %s", err) 163 | } 164 | }, 165 | } 166 | 167 | var lookupIspCmd = &cobra.Command{ 168 | Use: "isp", 169 | Example: ` 170 | # Lookup ISP by ip or hostname: 171 | 172 | nw lu isp 8.8.8.8 173 | nw lu isp dns.google. 174 | 175 | # Lookup ISP by ip or hostname and output as json: 176 | 177 | nw lu isp 8.8.8.8 -o json 178 | nw lu isp dns.google. -o json 179 | 180 | # Lookup ISP by ip or hostname and output as yaml: 181 | 182 | nw lu isp 8.8.8.8 -o yaml 183 | nw lu isp dns.google. -o yaml 184 | `, 185 | Short: "Lookup the internet service provider of a remote host.", 186 | Args: cobra.ExactArgs(1), 187 | Run: func(cmd *cobra.Command, args []string) { 188 | _, ip, err := resolve.HostAndAddr(args[0]) 189 | if err != nil { 190 | usage.Fatalf(cmd, "%q is an invalid host: %s", args[0], err) 191 | } 192 | 193 | if resolve.IsPrivate(ip) { 194 | usage.Fatalf(cmd, "cannot retrieve internet service provider for private ip") 195 | } 196 | 197 | isp, err := resolve.ServiceProvider(ip) 198 | if err != nil { 199 | usage.Fatalf(cmd, "failed to resolve internet service provider for %q: %s", ip, err) 200 | } 201 | 202 | enc := encoder.New[resolve.InternetServiceProvider](os.Stdout, output) 203 | if err := enc.Encode(*isp); err != nil { 204 | usage.Fatalf(cmd, "failed to encode internet service provider: %s", err) 205 | } 206 | }, 207 | } 208 | 209 | var lookupNameserversCmd = &cobra.Command{ 210 | Use: "nameservers", 211 | Aliases: []string{"ns"}, 212 | Short: "Lookup nameservers for the provided hostname.", 213 | Example: ` 214 | # Lookup nameservers by hostname: 215 | 216 | nw lu ns dns.google. 217 | 218 | # Lookup nameservers by hostname and output as json: 219 | 220 | nw lu ns dns.google. -o json 221 | 222 | # Lookup nameservers by hostname and output as yaml: 223 | 224 | nw lu ns dns.google. -o yaml 225 | `, 226 | Args: cobra.ExactArgs(1), 227 | Run: func(cmd *cobra.Command, args []string) { 228 | hostname, _, err := resolve.HostAndAddr(args[0]) 229 | if err != nil { 230 | usage.Fatalf(cmd, "%q is an invalid host: %s", args[0], err) 231 | } 232 | 233 | nameservers, err := resolve.NameServersByHostName(hostname) 234 | if err != nil { 235 | usage.Fatalf(cmd, "lookup failed: %s", err) 236 | } 237 | 238 | enc := encoder.New[resolve.NameServer](os.Stdout, output) 239 | if err := enc.Encode(nameservers...); err != nil { 240 | usage.Fatalf(cmd, "failed to encode nameservers: %s", err) 241 | } 242 | }, 243 | } 244 | 245 | var lookupNetworkCmd = &cobra.Command{ 246 | Use: "network", 247 | Short: "Lookup the network address of a provided host.", 248 | Example: ` 249 | # Lookup network by ip or hostname: 250 | 251 | nw lu n 8.8.8.8 252 | nw lu n dns.google. 253 | 254 | # Lookup network by ip or hostname and output as json: 255 | 256 | nw lu n 8.8.8.8 -o json 257 | nw lu n dns.google. -o json 258 | 259 | # Lookup network by ip or hostname and output as yaml: 260 | 261 | nw lu n 8.8.8.8 -o yaml 262 | nw lu n dns.google. -o yaml 263 | 264 | `, 265 | Args: cobra.ExactArgs(1), 266 | Aliases: []string{"n"}, 267 | Run: func(cmd *cobra.Command, args []string) { 268 | nwRecord, err := resolve.NetworkByHost(args[0]) 269 | if err != nil { 270 | usage.Fatalf(cmd, "lookup failed: %s", err) 271 | } 272 | 273 | enc := encoder.New[resolve.NetworkRecord](os.Stdout, output) 274 | if err := enc.Encode(*nwRecord); err != nil { 275 | usage.Fatalf(cmd, "failed to encode network record: %s", err) 276 | } 277 | }, 278 | } 279 | -------------------------------------------------------------------------------- /cmd/lookup_test.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "os/exec" 6 | "testing" 7 | 8 | "github.com/fuskovic/nw/v4/internal/resolve" 9 | "github.com/fuskovic/nw/v4/internal/test" 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func TestLookupHostnameCommand(t *testing.T) { 14 | t.Run("ShouldPass", func(t *testing.T) { 15 | test.WithNw(t, "lookup hostname", func(t *testing.T) { 16 | cmd := exec.Command("nw", "lookup", "hostname", "8.8.8.8") 17 | output, err := cmd.CombinedOutput() 18 | require.NoError(t, err) 19 | require.Contains(t, string(output), "dns.google.") 20 | }) 21 | test.WithNw(t, "lookup hostname output as json", func(t *testing.T) { 22 | cmd := exec.Command("nw", "lookup", "hostname", "8.8.8.8", "-o", "json") 23 | output, err := cmd.CombinedOutput() 24 | require.NoError(t, err) 25 | record := new(resolve.Record) 26 | require.NoError(t, json.Unmarshal(output, record)) 27 | require.Equal(t, "dns.google.", record.Hostname) 28 | 29 | }) 30 | test.WithNw(t, "lookup hostname output as yaml", func(t *testing.T) { 31 | cmd := exec.Command("nw", "lookup", "hostname", "8.8.8.8", "-o", "yaml") 32 | output, err := cmd.CombinedOutput() 33 | require.NoError(t, err) 34 | require.Contains(t, string(output), "- hostname: dns.google.") 35 | }) 36 | }) 37 | t.Run("ShouldFail", func(t *testing.T) { 38 | test.WithNw(t, "lookup hostname no ip address provided", func(t *testing.T) { 39 | cmd := exec.Command("nw", "lookup", "hostname") 40 | output, _ := cmd.CombinedOutput() 41 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 42 | }) 43 | test.WithNw(t, "lookup hostname invalid ip address", func(t *testing.T) { 44 | cmd := exec.Command("nw", "lookup", "hostname", "invalid") 45 | output, _ := cmd.CombinedOutput() 46 | require.Contains(t, string(output), "not a valid ip address") 47 | }) 48 | }) 49 | } 50 | 51 | func TestLookupIpAddressCommand(t *testing.T) { 52 | t.Run("ShouldPass", func(t *testing.T) { 53 | test.WithNw(t, "lookup ip", func(t *testing.T) { 54 | cmd := exec.Command("nw", "lookup", "ip", "dns.google.") 55 | output, err := cmd.CombinedOutput() 56 | require.NoError(t, err) 57 | require.Contains(t, string(output), "8.8.") 58 | }) 59 | test.WithNw(t, "lookup ip output as json", func(t *testing.T) { 60 | cmd := exec.Command("nw", "lookup", "ip", "dns.google.", "-o", "json") 61 | output, err := cmd.CombinedOutput() 62 | require.NoError(t, err) 63 | record := new(resolve.Record) 64 | require.NoError(t, json.Unmarshal(output, record)) 65 | require.Equal(t, "dns.google.", record.Hostname) 66 | 67 | }) 68 | test.WithNw(t, "lookup ip output as yaml", func(t *testing.T) { 69 | cmd := exec.Command("nw", "lookup", "ip", "dns.google.", "-o", "yaml") 70 | output, err := cmd.CombinedOutput() 71 | require.NoError(t, err) 72 | require.Contains(t, string(output), "- hostname: dns.google.") 73 | }) 74 | }) 75 | t.Run("ShouldFail", func(t *testing.T) { 76 | test.WithNw(t, "lookup ip address hostname not provided", func(t *testing.T) { 77 | cmd := exec.Command("nw", "lookup", "ip") 78 | output, _ := cmd.CombinedOutput() 79 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 80 | }) 81 | test.WithNw(t, "lookup ip address but ip provided instead of hostname", func(t *testing.T) { 82 | cmd := exec.Command("nw", "lookup", "ip", "8.8.8.8") 83 | output, _ := cmd.CombinedOutput() 84 | require.Contains(t, string(output), `expected a hostname not an ip address`) 85 | }) 86 | }) 87 | } 88 | 89 | func TestLookupIspCommand(t *testing.T) { 90 | t.Run("ShouldPass", func(t *testing.T) { 91 | test.WithNw(t, "lookup isp with hostname", func(t *testing.T) { 92 | cmd := exec.Command("nw", "lookup", "isp", "dns.google.") 93 | output, err := cmd.CombinedOutput() 94 | require.NoError(t, err) 95 | require.Contains(t, string(output), "GOOGLE, US") 96 | }) 97 | test.WithNw(t, "lookup isp with hostname output as json output", func(t *testing.T) { 98 | cmd := exec.Command("nw", "lookup", "isp", "dns.google.", "-o", "json") 99 | output, err := cmd.CombinedOutput() 100 | require.NoError(t, err) 101 | isp := new(resolve.InternetServiceProvider) 102 | require.NoError(t, json.Unmarshal(output, isp)) 103 | }) 104 | test.WithNw(t, "lookup isp with hostname output as yaml output", func(t *testing.T) { 105 | cmd := exec.Command("nw", "lookup", "isp", "dns.google.", "-o", "yaml") 106 | output, err := cmd.CombinedOutput() 107 | require.NoError(t, err) 108 | require.Contains(t, string(output), "- name: GOOGLE, US") 109 | }) 110 | test.WithNw(t, "lookup isp with ip address", func(t *testing.T) { 111 | cmd := exec.Command("nw", "lookup", "isp", "8.8.8.8") 112 | output, err := cmd.CombinedOutput() 113 | require.NoError(t, err) 114 | require.Contains(t, string(output), "GOOGLE, US") 115 | }) 116 | test.WithNw(t, "lookup isp with ip address output as json output", func(t *testing.T) { 117 | cmd := exec.Command("nw", "lookup", "isp", "8.8.8.8", "-o", "json") 118 | output, err := cmd.CombinedOutput() 119 | require.NoError(t, err) 120 | isp := new(resolve.InternetServiceProvider) 121 | require.NoError(t, json.Unmarshal(output, isp)) 122 | }) 123 | test.WithNw(t, "lookup isp with ip address output as yaml output", func(t *testing.T) { 124 | cmd := exec.Command("nw", "lookup", "isp", "8.8.8.8", "-o", "yaml") 125 | output, err := cmd.CombinedOutput() 126 | require.NoError(t, err) 127 | require.Contains(t, string(output), "- name: GOOGLE, US") 128 | }) 129 | }) 130 | t.Run("ShouldFail", func(t *testing.T) { 131 | test.WithNw(t, "lookup isp no host provided", func(t *testing.T) { 132 | cmd := exec.Command("nw", "lookup", "isp") 133 | output, _ := cmd.CombinedOutput() 134 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 135 | }) 136 | test.WithNw(t, "lookup isp for private ip address", func(t *testing.T) { 137 | cmd := exec.Command("nw", "lookup", "isp", "127.0.0.1") 138 | output, err := cmd.CombinedOutput() 139 | require.Error(t, err) 140 | require.Contains(t, string(output), "cannot retrieve internet service provider for private ip") 141 | }) 142 | }) 143 | } 144 | 145 | func TestLookupNetworkCommand(t *testing.T) { 146 | t.Run("ShouldPass", func(t *testing.T) { 147 | test.WithNw(t, "lookup network with hostname", func(t *testing.T) { 148 | cmd := exec.Command("nw", "lookup", "network", "dns.google.") 149 | output, err := cmd.CombinedOutput() 150 | require.NoError(t, err) 151 | require.Contains(t, string(output), "8.0.0.0") 152 | }) 153 | test.WithNw(t, "lookup network with hostname output as json", func(t *testing.T) { 154 | cmd := exec.Command("nw", "lookup", "network", "dns.google.", "-o", "json") 155 | output, err := cmd.CombinedOutput() 156 | require.NoError(t, err) 157 | record := new(resolve.NetworkRecord) 158 | require.NoError(t, err, json.Unmarshal(output, &record)) 159 | require.Equal(t, "8.0.0.0", record.NetworkIP.String()) 160 | }) 161 | test.WithNw(t, "lookup network with hostname output as yaml", func(t *testing.T) { 162 | cmd := exec.Command("nw", "lookup", "network", "dns.google.", "-o", "yaml") 163 | output, err := cmd.CombinedOutput() 164 | require.NoError(t, err) 165 | require.Contains(t, string(output), "network: 8.0.0.0") 166 | }) 167 | test.WithNw(t, "lookup network with ip", func(t *testing.T) { 168 | cmd := exec.Command("nw", "lookup", "network", "8.8.8.8") 169 | output, err := cmd.CombinedOutput() 170 | require.NoError(t, err) 171 | require.Contains(t, string(output), "8.0.0.0") 172 | }) 173 | test.WithNw(t, "lookup network with ip output as json", func(t *testing.T) { 174 | cmd := exec.Command("nw", "lookup", "network", "8.8.8.8", "-o", "json") 175 | output, err := cmd.CombinedOutput() 176 | require.NoError(t, err) 177 | record := new(resolve.NetworkRecord) 178 | require.NoError(t, err, json.Unmarshal(output, &record)) 179 | require.Equal(t, "8.0.0.0", record.NetworkIP.String()) 180 | }) 181 | test.WithNw(t, "lookup network with ip output as yaml", func(t *testing.T) { 182 | cmd := exec.Command("nw", "lookup", "network", "8.8.8.8", "-o", "yaml") 183 | output, err := cmd.CombinedOutput() 184 | require.NoError(t, err) 185 | require.Contains(t, string(output), "network: 8.0.0.0") 186 | }) 187 | }) 188 | t.Run("ShouldFail", func(t *testing.T) { 189 | test.WithNw(t, "lookup network no arg provided", func(t *testing.T) { 190 | cmd := exec.Command("nw", "lookup", "network") 191 | output, _ := cmd.CombinedOutput() 192 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 193 | }) 194 | test.WithNw(t, "lookup network invalid arg", func(t *testing.T) { 195 | cmd := exec.Command("nw", "lookup", "network", "invalid") 196 | output, _ := cmd.CombinedOutput() 197 | require.Contains(t, string(output), "invalild host") 198 | }) 199 | }) 200 | } 201 | 202 | func TestLookupNameserversCommand(t *testing.T) { 203 | t.Run("ShouldPass", func(t *testing.T) { 204 | test.WithNw(t, "lookup nameservers with hostname", func(t *testing.T) { 205 | cmd := exec.Command("nw", "lookup", "nameservers", "dns.google.") 206 | output, err := cmd.CombinedOutput() 207 | require.NoError(t, err) 208 | require.Contains(t, string(output), "ns1.zdns.google.") 209 | }) 210 | test.WithNw(t, "lookup nameservers with hostname output as json", func(t *testing.T) { 211 | cmd := exec.Command("nw", "lookup", "nameservers", "dns.google.", "-o", "json") 212 | output, err := cmd.CombinedOutput() 213 | require.NoError(t, err) 214 | var nameservers []resolve.NameServer 215 | require.NoError(t, err, json.Unmarshal(output, &nameservers)) 216 | require.False(t, len(nameservers) == 0) 217 | }) 218 | test.WithNw(t, "lookup nameservers with hostname output as yaml", func(t *testing.T) { 219 | cmd := exec.Command("nw", "lookup", "nameservers", "dns.google.", "-o", "yaml") 220 | output, err := cmd.CombinedOutput() 221 | require.NoError(t, err) 222 | require.Contains(t, string(output), "host: ns1.zdns.google.") 223 | }) 224 | test.WithNw(t, "lookup nameservers with ip", func(t *testing.T) { 225 | cmd := exec.Command("nw", "lookup", "nameservers", "8.8.8.8") 226 | output, err := cmd.CombinedOutput() 227 | require.NoError(t, err) 228 | require.Contains(t, string(output), "ns1.zdns.google.") 229 | }) 230 | test.WithNw(t, "lookup nameservers with ip output as json", func(t *testing.T) { 231 | cmd := exec.Command("nw", "lookup", "nameservers", "8.8.8.8", "-o", "json") 232 | output, err := cmd.CombinedOutput() 233 | require.NoError(t, err) 234 | var nameservers []resolve.NameServer 235 | require.NoError(t, err, json.Unmarshal(output, &nameservers)) 236 | require.False(t, len(nameservers) == 0) 237 | }) 238 | test.WithNw(t, "lookup nameservers with ip output as yaml", func(t *testing.T) { 239 | cmd := exec.Command("nw", "lookup", "nameservers", "8.8.8.8", "-o", "yaml") 240 | output, err := cmd.CombinedOutput() 241 | require.NoError(t, err) 242 | require.Contains(t, string(output), "host: ns1.zdns.google.") 243 | }) 244 | }) 245 | t.Run("ShouldFail", func(t *testing.T) { 246 | test.WithNw(t, "lookup nameservers hostname not provided", func(t *testing.T) { 247 | cmd := exec.Command("nw", "lookup", "nameservers") 248 | output, _ := cmd.CombinedOutput() 249 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 250 | }) 251 | test.WithNw(t, "lookup nameservers hostname doesnt exist", func(t *testing.T) { 252 | cmd := exec.Command("nw", "lookup", "nameservers", "doesntexist") 253 | output, err := cmd.CombinedOutput() 254 | require.Error(t, err) 255 | require.Contains(t, string(output), "lookup failed") 256 | }) 257 | test.WithNw(t, "lookup network no host provided", func(t *testing.T) { 258 | cmd := exec.Command("nw", "lookup", "network") 259 | output, _ := cmd.CombinedOutput() 260 | require.Contains(t, string(output), "Error: accepts 1 arg(s), received 0") 261 | }) 262 | }) 263 | } 264 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cdr.dev/coder-cli v1.17.0 h1:mmDksrdTVyASQSnB7h0yI4+IBp728OOlYZx3sMmSNdM= 2 | cdr.dev/coder-cli v1.17.0/go.mod h1:qx4lPbKKSbXOYQMP6KeRkhrmh2RO3QAZmS7fginCoA0= 3 | cdr.dev/slog v1.3.0/go.mod h1:C5OL99WyuOK8YHZdYY57dAPN1jK2WJlCdq2VP6xeQns= 4 | cdr.dev/slog v1.4.0 h1:tLXQJ/hZ5Q051h0MBHSd2Ha8xzdXj7CjtzmG/8dUvUk= 5 | cdr.dev/slog v1.4.0/go.mod h1:C5OL99WyuOK8YHZdYY57dAPN1jK2WJlCdq2VP6xeQns= 6 | cdr.dev/wsep v0.0.0-20200728013649-82316a09813f/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y= 7 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 8 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 9 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 10 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 11 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 12 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 13 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 14 | cloud.google.com/go v0.49.0/go.mod h1:hGvAdzcWNbyuxS3nWhD7H2cIJxjRRTRLQVB0bdputVY= 15 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 16 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 17 | cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= 18 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 19 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 20 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 21 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 22 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 23 | github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= 24 | github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= 25 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 26 | github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= 27 | github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= 28 | github.com/alecthomas/chroma v0.7.0 h1:z+0HgTUmkpRDRz0SRSdMaqOLfJV4F+N1FPDZUZIDUzw= 29 | github.com/alecthomas/chroma v0.7.0/go.mod h1:1U/PfCsTALWWYHDnsIQkxEBM0+6LLe0v8+RSVMOwxeY= 30 | github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= 31 | github.com/alecthomas/kong v0.1.17-0.20190424132513-439c674f7ae0/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= 32 | github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= 33 | github.com/alecthomas/kong-hcl v0.1.8-0.20190615233001-b21fea9723c8/go.mod h1:MRgZdU3vrFd05IQ89AxUZ0aYdF39BYoNFa324SodPCA= 34 | github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= 35 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 36 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 37 | github.com/ammario/ipisp v1.0.0 h1:U4xdVMBFWm0/4sHrQ3hVMC+ygg/Ynm4/vdFdkVAex1o= 38 | github.com/ammario/ipisp v1.0.0/go.mod h1:HM60VFpmEWyU+FisnTTHCeswaU3RW0dCVHihgIGUEGM= 39 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 40 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 41 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 42 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 43 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 44 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 45 | github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 46 | github.com/briandowns/spinner v1.11.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= 47 | github.com/briandowns/spinner v1.23.2 h1:Zc6ecUnI+YzLmJniCfDNaMbW0Wid1d5+qcTq4L2FW8w= 48 | github.com/briandowns/spinner v1.23.2/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM= 49 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 50 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 51 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 52 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 53 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 54 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 55 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 56 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 57 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 58 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 59 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 60 | github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 61 | github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 62 | github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= 63 | github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 64 | github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 65 | github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= 66 | github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= 67 | github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= 68 | github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= 69 | github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= 70 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 71 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 72 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 73 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 74 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 75 | github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= 76 | github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= 77 | github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= 78 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 79 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 80 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 81 | github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= 82 | github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= 83 | github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= 84 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 85 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 86 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 87 | github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= 88 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 89 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 90 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 91 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 92 | github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 93 | github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= 94 | github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= 95 | github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= 96 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 97 | github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= 98 | github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= 99 | github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= 100 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 101 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 102 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 103 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 104 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 105 | github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= 106 | github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 107 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 108 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 109 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 110 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 111 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 112 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 113 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 114 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 115 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 116 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 117 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 118 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 119 | github.com/google/go-cmp v0.3.2-0.20191216170541-340f1ebe299e/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 120 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 121 | github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= 122 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 123 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 124 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 125 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 126 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 127 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 128 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 129 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 130 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 131 | github.com/gorilla/csrf v1.6.0/go.mod h1:7tSf8kmjNYr7IWDCYhd3U8Ck34iQ/Yw5CJu7bAkHEGI= 132 | github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= 133 | github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= 134 | github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= 135 | github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 136 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 137 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 138 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 139 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 140 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 141 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 142 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 143 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 144 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 145 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 146 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 147 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 148 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 149 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 150 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 151 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 152 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 153 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 154 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 155 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 156 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 157 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 158 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 159 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 160 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 161 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 162 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 163 | github.com/jackpal/gateway v1.1.1 h1:UXXXkJGIHFsStms9ZBgGpoaFEJP7oJtFn5vplIT68E8= 164 | github.com/jackpal/gateway v1.1.1/go.mod h1:Tl1vZVtUaXx5j6P5HFmv45alhEi4yHHLfT4PRbB7eyw= 165 | github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 166 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 167 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 168 | github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 169 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 170 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 171 | github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= 172 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 173 | github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f/go.mod h1:4rEELDSfUAlBSyUjPG0JnaNGjf13JySHFeRdD/3dLP0= 174 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 175 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 176 | github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 177 | github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 178 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 179 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 180 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 181 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 182 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 183 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 184 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 185 | github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= 186 | github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= 187 | github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 188 | github.com/manifoldco/promptui v0.8.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= 189 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 190 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 191 | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 192 | github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 193 | github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= 194 | github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= 195 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 196 | github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 197 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 198 | github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= 199 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 200 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 201 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 202 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 203 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 204 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 205 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 206 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 207 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 208 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 209 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 210 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 211 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 212 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 213 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 214 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 215 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 216 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 217 | github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= 218 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 219 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 220 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 221 | github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= 222 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 223 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 224 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 225 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 226 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 227 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 228 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 229 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 230 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 231 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 232 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 233 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 234 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 235 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 236 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 237 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 238 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 239 | github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= 240 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 241 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 242 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 243 | github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 244 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 245 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 246 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 247 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 248 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 249 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 250 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 251 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 252 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 253 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 254 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 255 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 256 | github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= 257 | github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= 258 | github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= 259 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 260 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 261 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 262 | github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 263 | github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= 264 | github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 265 | github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= 266 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 267 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 268 | github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= 269 | github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= 270 | github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 271 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 272 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 273 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 274 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 275 | github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= 276 | github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= 277 | github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 278 | github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e h1:nt2877sKfojlHCTOBXbpWjBkuWKritFaGIfgQwbQUls= 279 | github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e/go.mod h1:B4+Kq1u5FlULTjFSM707Q6e/cOHFv0z/6QRoxubDIQ8= 280 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 281 | github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= 282 | github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 283 | github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= 284 | github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= 285 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 286 | go.coder.com/cli v0.4.0/go.mod h1:hRTOURCR3LJF1FRW9arecgrzX+AHG7mfYMwThPIgq+w= 287 | go.coder.com/flog v0.0.0-20190906214207-47dd47ea0512/go.mod h1:83JsYgXYv0EOaXjIMnaZ1Fl6ddNB3fJnDZ/8845mUJ8= 288 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 289 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 290 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 291 | go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= 292 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 293 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 294 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 295 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 296 | go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= 297 | go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= 298 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 299 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 300 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 301 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 302 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 303 | golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 304 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 305 | golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= 306 | golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= 307 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 308 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 309 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 310 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 311 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 312 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 313 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 314 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 315 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 316 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 317 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 318 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 319 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 320 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 321 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 322 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 323 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 324 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 325 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 326 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 327 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 328 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 329 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 330 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 331 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 332 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 333 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 334 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 335 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 336 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 337 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 338 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 339 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 340 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 341 | golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= 342 | golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= 343 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 344 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 345 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 346 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 347 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 348 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 349 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 350 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 351 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 352 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 353 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 354 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 355 | golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 356 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 357 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 358 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 359 | golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 360 | golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 361 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 362 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 363 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 364 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 365 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 366 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 367 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 368 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 369 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 370 | golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 371 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 372 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 373 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 374 | golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 375 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 376 | golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= 377 | golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 378 | golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= 379 | golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= 380 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 381 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 382 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 383 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 384 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 385 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 386 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 387 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 388 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 389 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 390 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 391 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 392 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 393 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 394 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 395 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 396 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 397 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 398 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 399 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 400 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 401 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 402 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 403 | golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 404 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 405 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 406 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 407 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 408 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 409 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 410 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 411 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 412 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 413 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 414 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 415 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 416 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 417 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 418 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 419 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 420 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 421 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 422 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 423 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 424 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 425 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 426 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 427 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 428 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 429 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 430 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 431 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 432 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 433 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 434 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 435 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 436 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 437 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 438 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 439 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 440 | gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 441 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 442 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 443 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 444 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 445 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 446 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 447 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 448 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 449 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 450 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 451 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 452 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 453 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 454 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 455 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 456 | nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= 457 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 458 | --------------------------------------------------------------------------------