From ac2276d11877707d3d277b31882567e6abc7bc35 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 21 Sep 2020 20:24:51 +0200 Subject: [PATCH] refactoring --- .drone.jsonnet | 190 ++++++++++++++++++ .drone.star | 171 ---------------- .drone.yml | 53 +++-- .github/settings.yml | 55 +++++ .gitignore | 19 +- CHANGELOG.md | 4 +- LICENSE | 2 +- README.md | 17 +- cmd/url-parser/config.go | 24 +-- cmd/url-parser/main.go | 4 +- go.mod | 9 +- go.sum | 18 +- {commands => internal/command}/commands.go | 2 +- .../command}/commands_test.go | 2 +- {commands => internal/command}/fragment.go | 2 +- .../command}/fragment_test.go | 2 +- {commands => internal/command}/host.go | 2 +- {commands => internal/command}/host_test.go | 2 +- {commands => internal/command}/password.go | 2 +- .../command}/password_test.go | 2 +- {commands => internal/command}/path.go | 2 +- {commands => internal/command}/path_test.go | 2 +- {commands => internal/command}/port.go | 2 +- {commands => internal/command}/port_test.go | 2 +- {commands => internal/command}/query.go | 2 +- {commands => internal/command}/query_test.go | 2 +- {commands => internal/command}/run.go | 2 +- {commands => internal/command}/run_test.go | 2 +- {commands => internal/command}/scheme.go | 2 +- {commands => internal/command}/scheme_test.go | 2 +- {commands => internal/command}/user.go | 2 +- {commands => internal/command}/user_test.go | 2 +- 32 files changed, 349 insertions(+), 257 deletions(-) create mode 100644 .drone.jsonnet delete mode 100644 .drone.star create mode 100644 .github/settings.yml rename {commands => internal/command}/commands.go (93%) rename {commands => internal/command}/commands_test.go (96%) rename {commands => internal/command}/fragment.go (93%) rename {commands => internal/command}/fragment_test.go (97%) rename {commands => internal/command}/host.go (93%) rename {commands => internal/command}/host_test.go (97%) rename {commands => internal/command}/password.go (94%) rename {commands => internal/command}/password_test.go (97%) rename {commands => internal/command}/path.go (97%) rename {commands => internal/command}/path_test.go (98%) rename {commands => internal/command}/port.go (93%) rename {commands => internal/command}/port_test.go (97%) rename {commands => internal/command}/query.go (97%) rename {commands => internal/command}/query_test.go (98%) rename {commands => internal/command}/run.go (93%) rename {commands => internal/command}/run_test.go (97%) rename {commands => internal/command}/scheme.go (93%) rename {commands => internal/command}/scheme_test.go (97%) rename {commands => internal/command}/user.go (94%) rename {commands => internal/command}/user_test.go (97%) diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..f314bc5 --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,190 @@ +local PipelineTest = { + kind: 'pipeline', + name: 'test', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'staticcheck', + image: 'golang:1.14', + commands: [ + 'go run honnef.co/go/tools/cmd/staticcheck ./...', + ], + volumes: [ + { + name: 'gopath', + path: '/go', + }, + ], + }, + { + name: 'lint', + image: 'golang:1.14', + commands: [ + 'go run golang.org/x/lint/golint -set_exit_status ./...', + ], + volumes: [ + { + name: 'gopath', + path: '/go', + }, + ], + }, + { + name: 'vet', + image: 'golang:1.14', + commands: [ + 'go vet ./...', + ], + volumes: [ + { + name: 'gopath', + path: '/go', + }, + ], + }, + { + name: 'test', + image: 'golang:1.14', + commands: [ + 'go test -race -coverprofile=coverage.txt -covermode=atomic ./...', + ], + volumes: [ + { + name: 'gopath', + path: '/go', + }, + ], + }, + { + name: 'coverage', + image: 'plugins/codecov', + settings: { + token: { + from_secret: 'codecov_token', + }, + files: [ + 'coverage.txt', + ], + }, + }, + ], + volumes: [ + { + name: 'gopath', + temp: {}, + }, + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, +}; + + +local PipelineBuildBinaries = { + kind: 'pipeline', + name: 'build-binaries', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'build', + image: 'techknowlogick/xgo:go-1.14.x', + commands: [ + '[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}', + 'mkdir -p release/', + "cd cmd/github-releases-notifier && xgo -ldflags \"-s -w -X main.version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out github-releases-notifier .", + 'mv /build/* /drone/src/release/', + ], + }, + { + name: 'executable', + image: 'alpine', + commands: [ + '$(find release/ -executable -type f | grep github-releases-notifier-linux-amd64) --help', + ], + }, + { + name: 'compress', + image: 'alpine', + commands: [ + 'apk add upx', + 'find release/ -maxdepth 1 -executable -type f -exec upx {} \\;', + 'ls -lh release/', + ], + }, + { + name: 'checksum', + image: 'alpine', + commands: [ + 'cd release/ && sha256sum * > sha256sum.txt', + ], + }, + { + name: 'publish', + image: 'plugins/github-release', + settings: { + overwrite: true, + api_key: { + from_secret: 'github_token', + }, + files: ['release/*'], + title: '${DRONE_TAG}', + note: 'CHANGELOG.md', + }, + when: { + ref: [ + 'refs/tags/**', + ], + }, + }, + ], + depends_on: [ + 'test', + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, +}; + +local PipelineNotifications = { + kind: 'pipeline', + name: 'notifications', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'matrix', + image: 'plugins/matrix', + settings: { + homeserver: { from_secret: 'matrix_homeserver' }, + roomid: { from_secret: 'matrix_roomid' }, + template: 'Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}', + username: { from_secret: 'matrix_username' }, + password: { from_secret: 'matrix_password' }, + }, + when: { + status: ['success', 'failure'], + }, + }, + ], + depends_on: [ + 'build-binaries', + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**'], + status: ['success', 'failure'], + }, +}; + +[ + PipelineTest, + PipelineBuildBinaries, + PipelineNotifications, +] diff --git a/.drone.star b/.drone.star deleted file mode 100644 index f8a7a4f..0000000 --- a/.drone.star +++ /dev/null @@ -1,171 +0,0 @@ -def main(ctx): - before = testing() - - stages = [ - binaries([]), - ] - - after = notification() - - for b in before: - for s in stages: - s['depends_on'].append(b['name']) - - for s in stages: - for a in after: - a['depends_on'].append(s['name']) - - return before + stages + after - -def testing(): - return [{ - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'testing', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'vet', - 'image': 'golang:1.12', - 'commands': [ - 'go vet ./...' - ], - }, - { - 'name': 'test', - 'image': 'golang:1.12', - 'commands': [ - 'go test -race -coverprofile=coverage.txt -covermode=atomic ./...' - ], - }, - { - 'name': 'coverage', - 'image': 'plugins/codecov', - 'settings': { - 'token': { - 'from_secret': 'codecov_token', - }, - 'files':[ - 'coverage.txt' - ], - }, - }, - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**' - ] - } - }] - -def binaries(arch): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'build-binaries', - 'steps': [ - { - 'name': 'build', - 'image': 'techknowlogick/xgo:latest', - 'commands': [ - '[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}', - 'mkdir -p release/', - "cd cmd/url-parser && xgo -ldflags \"-s -w -X main.Version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out url-parser-$BUILD_VERSION .", - 'cp /build/* /drone/src/release/' - ] - }, - { - 'name': 'executable', - 'image': 'alpine', - 'commands': [ - '$(find release/ -executable -type f | grep url-parser-.*-linux-amd64) --help', - ] - }, - { - 'name': 'compress', - 'image': 'alpine', - 'commands': [ - 'apk add upx', - 'find release/ -maxdepth 1 -executable -type f -exec upx {} \;', - 'ls -lh release/', - ] - }, - { - 'name': 'checksum', - 'image': 'alpine', - 'commands': [ - 'cd release/ && sha256sum * > sha256sum.txt', - ], - }, - { - 'name': 'publish', - 'image': 'plugins/github-release', - 'settings': { - 'overwrite': True, - 'api_key': { - 'from_secret': 'github_token' - }, - 'files': [ "release/*" ], - 'title': '${DRONE_TAG}', - 'note': 'CHANGELOG.md', - }, - 'when': { - 'ref': [ - 'refs/tags/**' - ] - } - } - ], - 'depends_on': [], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**' - ] - } - } - -def notification(): - return [{ - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'notification', - 'steps': [ - { - 'name': 'matrix', - 'image': 'plugins/matrix', - 'settings': { - 'homeserver': { - 'from_secret': 'matrix_homeserver', - }, - 'password': { - 'from_secret': 'matrix_password', - }, - 'roomid': { - 'from_secret': 'matrix_roomid', - }, - 'template': 'Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}', - 'username': { - 'from_secret': 'matrix_username', - }, - }, - }, - ], - 'depends_on': [], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - ], - 'status': [ - 'success', - 'failure' - ] - } - }] diff --git a/.drone.yml b/.drone.yml index 585eb23..f37ef8b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,22 +1,43 @@ --- kind: pipeline -type: docker -name: testing +name: test platform: os: linux arch: amd64 steps: +- name: staticcheck + image: golang:1.14 + commands: + - go run honnef.co/go/tools/cmd/staticcheck ./... + volumes: + - name: gopath + path: /go + +- name: lint + image: golang:1.14 + commands: + - go run golang.org/x/lint/golint -set_exit_status ./... + volumes: + - name: gopath + path: /go + - name: vet - image: golang:1.12 + image: golang:1.14 commands: - go vet ./... + volumes: + - name: gopath + path: /go - name: test - image: golang:1.12 + image: golang:1.14 commands: - go test -race -coverprofile=coverage.txt -covermode=atomic ./... + volumes: + - name: gopath + path: /go - name: coverage image: plugins/codecov @@ -26,6 +47,10 @@ steps: token: from_secret: codecov_token +volumes: +- name: gopath + temp: {} + trigger: ref: - refs/heads/master @@ -34,7 +59,6 @@ trigger: --- kind: pipeline -type: docker name: build-binaries platform: @@ -43,17 +67,17 @@ platform: steps: - name: build - image: techknowlogick/xgo:latest + image: techknowlogick/xgo:go-1.14.x commands: - "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}" - mkdir -p release/ - - cd cmd/url-parser && xgo -ldflags "-s -w -X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out url-parser-$BUILD_VERSION . - - cp /build/* /drone/src/release/ + - cd cmd/github-releases-notifier && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out github-releases-notifier . + - mv /build/* /drone/src/release/ - name: executable image: alpine commands: - - $(find release/ -executable -type f | grep url-parser-.*-linux-amd64) --help + - $(find release/ -executable -type f | grep github-releases-notifier-linux-amd64) --help - name: compress image: alpine @@ -88,12 +112,11 @@ trigger: - refs/pull/** depends_on: -- testing +- test --- kind: pipeline -type: docker -name: notification +name: notifications platform: os: linux @@ -112,6 +135,10 @@ steps: template: "Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}" username: from_secret: matrix_username + when: + status: + - success + - failure trigger: ref: @@ -126,6 +153,6 @@ depends_on: --- kind: signature -hmac: 999c45dd679c809e8dc40c3f72d4e6a3f95c5f57f14ca2aba3472b7226893d13 +hmac: 5ca11cf4dc76a28155711c9665abeab4a3e61a5bd8c819588a76ba8baef16cfe ... diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..c360d9f --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,55 @@ +repository: + name: url-parser + description: Simple command-line URL parser + topics: cli, tools, url, parser + + private: false + has_issues: true + has_wiki: false + has_downloads: true + + default_branch: master + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + +labels: + - name: bug + color: d73a4a + description: Something isn't working + - name: documentation + color: 0075ca + description: Improvements or additions to documentation + - name: duplicate + color: cfd3d7 + description: This issue or pull request already exists + - name: enhancement + color: a2eeef + description: New feature or request + - name: good first issue + color: 7057ff + description: Good for newcomers + - name: help wanted + color: 008672 + description: Extra attention is needed + - name: invalid + color: e4e669 + description: This doesn't seem right + - name: question + color: d876e3 + description: Further information is requested + - name: wontfix + color: ffffff + description: This will not be worked on + +branches: + - name: master + protection: + required_pull_request_reviews: null + required_status_checks: + strict: true + contexts: + - continuous-integration/drone/pr + enforce_admins: null + restrictions: null diff --git a/.gitignore b/.gitignore index bfd2efd..a3f8ac4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,4 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib +/release/ +/url-parser* -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ -/url-parser -coverage.txt +coverage.out diff --git a/CHANGELOG.md b/CHANGELOG.md index bc05fd6..a4101a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ -* FEATURE - * Initial release +- INTERNAL + - refactor project structure diff --git a/LICENSE b/LICENSE index bb3e998..44e4d67 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Robert Kaussow +Copyright (c) 2020 Robert Kaussow Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 56a1301..6dc0bb5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # url-parser -[![Build Status](https://img.shields.io/drone/build/xoxys/url-parser?logo=drone)](https://cloud.drone.io/xoxys/url-parser) +Simple command-line URL parser + +[![Build Status](https://img.shields.io/drone/build/thegeeklab/url-parser?logo=drone)](https://cloud.drone.io/thegeeklab/url-parser) +[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/url-parser) +[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/url-parser) +[![Go Report Card](https://goreportcard.com/badge/github.com/thegeeklab/url-parser)](https://goreportcard.com/report/github.com/thegeeklab/url-parser) [![Codecov](https://img.shields.io/codecov/c/github/xoxys/url-parser)](https://codecov.io/gh/xoxys/url-parser) -[![Go Report Card](https://goreportcard.com/badge/github.com/xoxys/url-parser)](https://goreportcard.com/report/github.com/xoxys/url-parser) -[![License: MIT](https://img.shields.io/github/license/xoxys/url-parser)](LICENSE) +[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/url-parser) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/url-parser)](<[LICENSE](https://github.com/thegeeklab/url-parser/blob/master/LICENSE)>) Inspired by [herloct/url-parser](https://github.com/herloct/url-parser), a simple command-line utility for parsing URLs. @@ -12,7 +17,7 @@ Inspired by [herloct/url-parser](https://github.com/herloct/url-parser), a simpl Prebuild multiarch binaries are availabe for Linux only: ```Shell -curl -L https://github.com/xoxys/url-parser/releases/download/v0.1.0/url-parser-0.1.0-linux-amd64 > /usr/local/bin/url-parser +curl -L https://github.com/thegeeklab/url-parser/releases/download/v0.1.0/url-parser-0.1.0-linux-amd64 > /usr/local/bin/url-parser chmod +x /usr/local/bin/url-parser url-parser --help ``` @@ -73,7 +78,3 @@ somevalue ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. - -## Maintainers and Contributors - -[Robert Kaussow](https://github.com/xoxys) diff --git a/cmd/url-parser/config.go b/cmd/url-parser/config.go index 076aba1..edbfea1 100644 --- a/cmd/url-parser/config.go +++ b/cmd/url-parser/config.go @@ -1,8 +1,8 @@ package main import ( + "github.com/thegeeklab/url-parser/internal/command" "github.com/urfave/cli/v2" - "github.com/xoxys/url-parser/commands" ) func globalFlags() []cli.Flag { @@ -21,63 +21,63 @@ func configCommands() []*cli.Command { Name: "all", Aliases: []string{"a"}, Usage: "Get all parts from url", - Action: commands.Run, + Action: command.Run, Flags: globalFlags(), }, { Name: "scheme", Aliases: []string{"s"}, Usage: "Get scheme from url", - Action: commands.Scheme, + Action: command.Scheme, Flags: globalFlags(), }, { Name: "user", Aliases: []string{"u"}, Usage: "Get username from url", - Action: commands.User, + Action: command.User, Flags: globalFlags(), }, { Name: "password", Aliases: []string{"pw"}, Usage: "Get password from url", - Action: commands.Password, + Action: command.Password, Flags: globalFlags(), }, { Name: "path", Aliases: []string{"pt"}, Usage: "Get path from url", - Action: commands.Path, - Flags: append(globalFlags(), commands.PathFlags()...), + Action: command.Path, + Flags: append(globalFlags(), command.PathFlags()...), }, { Name: "host", Aliases: []string{"h"}, Usage: "Get hostname from url", - Action: commands.Host, + Action: command.Host, Flags: globalFlags(), }, { Name: "port", Aliases: []string{"p"}, Usage: "Get port from url", - Action: commands.Port, + Action: command.Port, Flags: globalFlags(), }, { Name: "query", Aliases: []string{"q"}, Usage: "Get query from url", - Action: commands.Query, - Flags: append(globalFlags(), commands.QueryFlags()...), + Action: command.Query, + Flags: append(globalFlags(), command.QueryFlags()...), }, { Name: "fragment", Aliases: []string{"f"}, Usage: "Get fragment from url", - Action: commands.Fragment, + Action: command.Fragment, Flags: globalFlags(), }, } diff --git a/cmd/url-parser/main.go b/cmd/url-parser/main.go index a291c63..c834e28 100644 --- a/cmd/url-parser/main.go +++ b/cmd/url-parser/main.go @@ -4,8 +4,8 @@ import ( "os" "github.com/sirupsen/logrus" + "github.com/thegeeklab/url-parser/internal/command" "github.com/urfave/cli/v2" - "github.com/xoxys/url-parser/commands" ) // Version of current build @@ -16,7 +16,7 @@ func main() { app.Name = "url-parser" app.Usage = "Parse URL and shows the part of it." app.Version = Version - app.Action = commands.Run + app.Action = command.Run app.Flags = globalFlags() app.Commands = configCommands() diff --git a/go.mod b/go.mod index 266f75d..aa6da05 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ -module github.com/xoxys/url-parser +module github.com/thegeeklab/url-parser go 1.13 require ( + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d - github.com/sirupsen/logrus v1.4.2 - github.com/urfave/cli v1.22.2 - github.com/urfave/cli/v2 v2.1.1 + github.com/sirupsen/logrus v1.6.0 + github.com/urfave/cli/v2 v2.2.0 + golang.org/x/sys v0.0.0-20200918174421-af09f7315aff // indirect ) diff --git a/go.sum b/go.sum index 4b7958e..fdd2744 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,29 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d h1:cVtBfNW5XTHiKQe7jDaDBSh/EVM4XLPutLAGboIXuM0= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= -github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= +github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/commands/commands.go b/internal/command/commands.go similarity index 93% rename from commands/commands.go rename to internal/command/commands.go index 1a494ef..7137296 100644 --- a/commands/commands.go +++ b/internal/command/commands.go @@ -1,4 +1,4 @@ -package commands +package command import ( "net/url" diff --git a/commands/commands_test.go b/internal/command/commands_test.go similarity index 96% rename from commands/commands_test.go rename to internal/command/commands_test.go index afb8b66..5f5dd7b 100644 --- a/commands/commands_test.go +++ b/internal/command/commands_test.go @@ -1,4 +1,4 @@ -package commands +package command import "testing" diff --git a/commands/fragment.go b/internal/command/fragment.go similarity index 93% rename from commands/fragment.go rename to internal/command/fragment.go index 6cb4954..23c5e34 100644 --- a/commands/fragment.go +++ b/internal/command/fragment.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/fragment_test.go b/internal/command/fragment_test.go similarity index 97% rename from commands/fragment_test.go rename to internal/command/fragment_test.go index f376b30..40b4108 100644 --- a/commands/fragment_test.go +++ b/internal/command/fragment_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/host.go b/internal/command/host.go similarity index 93% rename from commands/host.go rename to internal/command/host.go index 1373776..2b987ab 100644 --- a/commands/host.go +++ b/internal/command/host.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/host_test.go b/internal/command/host_test.go similarity index 97% rename from commands/host_test.go rename to internal/command/host_test.go index 5e8bb83..1d708d9 100644 --- a/commands/host_test.go +++ b/internal/command/host_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/password.go b/internal/command/password.go similarity index 94% rename from commands/password.go rename to internal/command/password.go index e46bd86..068cd45 100644 --- a/commands/password.go +++ b/internal/command/password.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/password_test.go b/internal/command/password_test.go similarity index 97% rename from commands/password_test.go rename to internal/command/password_test.go index 797c52c..5755b50 100644 --- a/commands/password_test.go +++ b/internal/command/password_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/path.go b/internal/command/path.go similarity index 97% rename from commands/path.go rename to internal/command/path.go index f6997d1..1e53162 100644 --- a/commands/path.go +++ b/internal/command/path.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/path_test.go b/internal/command/path_test.go similarity index 98% rename from commands/path_test.go rename to internal/command/path_test.go index d551e6d..d4eb4b8 100644 --- a/commands/path_test.go +++ b/internal/command/path_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/port.go b/internal/command/port.go similarity index 93% rename from commands/port.go rename to internal/command/port.go index 83fda61..20cce99 100644 --- a/commands/port.go +++ b/internal/command/port.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/port_test.go b/internal/command/port_test.go similarity index 97% rename from commands/port_test.go rename to internal/command/port_test.go index efb1c5b..d83e991 100644 --- a/commands/port_test.go +++ b/internal/command/port_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/query.go b/internal/command/query.go similarity index 97% rename from commands/query.go rename to internal/command/query.go index ae51e35..c71ba58 100644 --- a/commands/query.go +++ b/internal/command/query.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/query_test.go b/internal/command/query_test.go similarity index 98% rename from commands/query_test.go rename to internal/command/query_test.go index 3f3f0b2..95af1af 100644 --- a/commands/query_test.go +++ b/internal/command/query_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/run.go b/internal/command/run.go similarity index 93% rename from commands/run.go rename to internal/command/run.go index dd174b8..802aa95 100644 --- a/commands/run.go +++ b/internal/command/run.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/run_test.go b/internal/command/run_test.go similarity index 97% rename from commands/run_test.go rename to internal/command/run_test.go index 42d0f0a..022bfee 100644 --- a/commands/run_test.go +++ b/internal/command/run_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/scheme.go b/internal/command/scheme.go similarity index 93% rename from commands/scheme.go rename to internal/command/scheme.go index d8ddd2b..856af3b 100644 --- a/commands/scheme.go +++ b/internal/command/scheme.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/scheme_test.go b/internal/command/scheme_test.go similarity index 97% rename from commands/scheme_test.go rename to internal/command/scheme_test.go index 9e5b268..cb4bdc9 100644 --- a/commands/scheme_test.go +++ b/internal/command/scheme_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag" diff --git a/commands/user.go b/internal/command/user.go similarity index 94% rename from commands/user.go rename to internal/command/user.go index bcd6d3f..e6d34b2 100644 --- a/commands/user.go +++ b/internal/command/user.go @@ -1,4 +1,4 @@ -package commands +package command import ( "fmt" diff --git a/commands/user_test.go b/internal/command/user_test.go similarity index 97% rename from commands/user_test.go rename to internal/command/user_test.go index 680d1cb..a43fa97 100644 --- a/commands/user_test.go +++ b/internal/command/user_test.go @@ -1,4 +1,4 @@ -package commands +package command import ( "flag"