Skip to content

Commit

Permalink
feat: move go.mod on repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 23, 2020
1 parent 8e3ec74 commit 2b01d49
Show file tree
Hide file tree
Showing 88 changed files with 179 additions and 178 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ jobs:
# image: pathwar/pathwar

go-build:
working_directory: /go/src/pathwar.land/go
working_directory: /go/src/pathwar.land
docker:
- image: circleci/golang:1.13
steps:
- checkout:
path: /go/src/pathwar.land
- moul/mod-download
- gotools/mod-tidy-check
- run: make install
- run: SKIP_SLOW_TESTS=1 make unittest GO_TEST_OPTS="-test.timeout=60s -count=10"
- run: SKIP_SLOW_TESTS=0 make unittest GO_TEST_OPTS="-test.timeout=60s -count=2"
- run: cd go && make install
- run: cd go && SKIP_SLOW_TESTS=1 make unittest GO_TEST_OPTS="-test.timeout=60s -count=10"
- run: cd go && SKIP_SLOW_TESTS=0 make unittest GO_TEST_OPTS="-test.timeout=60s -count=2"
- moul/install_golangci-lint
- run: PATH=$PATH:$(pwd)/bin make lint
- run: cd go && PATH=$PATH:$(pwd)/bin make lint
- codecov/upload:
file: coverage.txt
file: go/coverage.txt

go-generate:
working_directory: /go/src/pathwar.land
Expand Down
21 changes: 12 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
.*~
.#*
*~
*#
.circleci/
coverage.txt
docker-compose.yml
Dockerfile
.dockerignore
.gitignore
node_modules
out/
package-lock.json
yarn.lock
.circleci/
test/
*~
.#*
.*~
Dockerfile
vendor/
.gitignore
.dockerignore
docker-compose.yml
yarn.lock
2 changes: 1 addition & 1 deletion go/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM golang:1.13-alpine as builder
RUN apk --no-cache --update add nodejs-npm make gcc g++ musl-dev openssl-dev git
ENV GO111MODULE=on GOPROXY=https://proxy.golang.org,direct
COPY go.mod go.sum /go/src/pathwar.land/go/
COPY go.mod go.sum /go/src/pathwar.land/
WORKDIR /go/src/pathwar.land/go
RUN go mod download
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="https://www.codefactor.io/repository/github/pathwar/pathwar"><img src="https://www.codefactor.io/repository/github/pathwar/pathwar/badge" alt="Code Factor"></a>
<a href="https://goreportcard.com/report/pathwar/pathwar"><img src="https://goreportcard.com/badge/pathwar/pathwar" alt="Go Report Card"></a>
<a href="https://github.com/pathwar/pathwar/releases"><img src="https://badge.fury.io/gh/pathwar%2Fpathwar.svg" alt="GitHub version"></a>
<a href="https://pkg.go.dev/pathwar.land/go/v2"><img src="https://img.shields.io/static/v1?label=godoc&message=reference&color=blue" alt="GoDoc"></a>
<a href="https://pkg.go.dev/pathwar.land/v2/go"><img src="https://img.shields.io/static/v1?label=godoc&message=reference&color=blue" alt="GoDoc"></a>
<a href="https://codecov.io/gh/pathwar/pathwar"><img src="https://codecov.io/gh/pathwar/pathwar/branch/master/graph/badge.svg" /></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gen.sum: $(GEN_SRC)

.PHONY: generate_local
generate_local:
protoc -I ../go/vendor/github.com/grpc-ecosystem/grpc-gateway:../api:../go/vendor:/protobuf --swagger_out=logtostderr=true:. ../api/pwapi.proto
protoc -I ../vendor/github.com/grpc-ecosystem/grpc-gateway:../api:../vendor:/protobuf --swagger_out=logtostderr=true:. ../api/pwapi.proto
echo 'swagger: "2.0"' > swagger.yaml.tmp
cat ./pwapi.swagger.json | json2yaml | grep -v 'swagger: "2.0"' >> swagger.yaml.tmp
rm -f ./pwapi.swagger.json
Expand Down
2 changes: 1 addition & 1 deletion docs/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module pathwar.land/go/v2
module pathwar.land/v2

require (
github.com/Microsoft/go-winio v0.4.14 // indirect
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions go/.dockerignore

This file was deleted.

14 changes: 8 additions & 6 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## moul/rules.mk
GOPATH ?= $(HOME)/go
GOPKG = pathwar.land/go
GOBINS = ./cmd/pathwar ./cmd/pwinit
DOCKER_IMAGE = pathwar/pathwar
GOMOD_DIR = ..
GOPKG = pathwar.land
GOBINS = ./cmd/pathwar ./cmd/pwinit
DOCKER_IMAGE =pathwar/pathwar
DOCKERFILE_PATH = ../Dockerfile

GO_INSTALL_OPTS = -v -ldflags "-s -w -X pathwar.land/go/v2/pkg/pwversion.Version=`git describe --tags --abbrev` -X pathwar.land/go/pkg/pwversion.Commit=`git rev-parse HEAD` -X pathwar.land/go/pkg/pwversion.Date=`date +%s` -X pathwar.land/go/pkg/pwversion.BuiltBy=makefile"
GO_INSTALL_OPTS = -v -ldflags "-s -w -X pathwar.land/v2/go/pkg/pwversion.Version=`git describe --tags --abbrev` -X pathwar.land/go/pkg/pwversion.Commit=`git rev-parse HEAD` -X pathwar.land/go/pkg/pwversion.Date=`date +%s` -X pathwar.land/go/pkg/pwversion.BuiltBy=makefile"
PRE_INSTALL_STEPS += generate
PRE_UNITTEST_STEPS += generate
PRE_TEST_STEPS += generate
Expand Down Expand Up @@ -92,10 +94,10 @@ gen.sum: $(GEN_SRC)
.PHONY: generate_local
generate_local:
@set -e; for proto in $(PROTOS_SRC); do ( set -xe; \
protoc -I ../go/vendor/github.com/grpc-ecosystem/grpc-gateway:../api:../go/vendor:/protobuf --grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" --gogofaster_out="plugins=grpc:$(GOPATH)/src" "$$proto" \
protoc -I ../vendor/github.com/grpc-ecosystem/grpc-gateway:../api:../vendor:/protobuf --grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" --gogofaster_out="plugins=grpc:$(GOPATH)/src" "$$proto" \
); done
@### custom
sed -i [email protected]/go/[email protected]/go/v2/pkg@ ./pkg/*/*.pb.go
sed -i [email protected]/go/[email protected]/v2/go/pkg@ ./pkg/*/*.pb.go
@### end of custom
goimports -w ./pkg ./cmd ./internal
shasum $(GEN_SRC) | sort > gen.sum.tmp
Expand Down
16 changes: 8 additions & 8 deletions go/cmd/pathwar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
"go.uber.org/zap/zapcore"
"golang.org/x/oauth2"
"moul.io/srand"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwagent"
"pathwar.land/go/v2/pkg/pwapi"
"pathwar.land/go/v2/pkg/pwcompose"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/go/v2/pkg/pwinit"
"pathwar.land/go/v2/pkg/pwsso"
"pathwar.land/go/v2/pkg/pwversion"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwagent"
"pathwar.land/v2/go/pkg/pwapi"
"pathwar.land/v2/go/pkg/pwcompose"
"pathwar.land/v2/go/pkg/pwdb"
"pathwar.land/v2/go/pkg/pwinit"
"pathwar.land/v2/go/pkg/pwsso"
"pathwar.land/v2/go/pkg/pwversion"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions go/cmd/pwinit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"syscall"

"github.com/peterbourgon/ff/ffcli"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwinit"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwinit"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go/doc.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package pathwar // import "pathwar.land/go/v2"
package pathwar // import "pathwar.land/v2/go"
2 changes: 1 addition & 1 deletion go/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/internal/randstring/randstring.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package randstring // import "pathwar.land/go/v2/internal/randstring"
package randstring // import "pathwar.land/v2/go/internal/randstring"

import "math/rand"

Expand Down
2 changes: 1 addition & 1 deletion go/internal/testutil/doc.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package testutil // import "pathwar.land/go/v2/internal/testutil"
package testutil // import "pathwar.land/v2/go/internal/testutil"
2 changes: 1 addition & 1 deletion go/pkg/errcode/doc.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package errcode // import "pathwar.land/go/v2/pkg/errcode"
package errcode // import "pathwar.land/v2/go/pkg/errcode"
4 changes: 2 additions & 2 deletions go/pkg/pwagent/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/gogo/protobuf/jsonpb"
"go.uber.org/zap"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwapi"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwapi"
)

func fetchAPIInstances(ctx context.Context, apiClient *http.Client, httpAPIAddr string, agentName string, logger *zap.Logger) (*pwapi.AgentListInstances_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwagent/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/docker/docker/client"
"go.uber.org/zap"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwcompose"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwcompose"
)

func Daemon(ctx context.Context, cli *client.Client, apiClient *http.Client, opts Opts) error {
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwagent/doc.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package pwagent // import "pathwar.land/go/v2/pkg/pwagent"
package pwagent // import "pathwar.land/v2/go/pkg/pwagent"
10 changes: 5 additions & 5 deletions go/pkg/pwagent/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"go.uber.org/zap"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwapi"
"pathwar.land/go/v2/pkg/pwcompose"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/go/v2/pkg/pwinit"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwapi"
"pathwar.land/v2/go/pkg/pwcompose"
"pathwar.land/v2/go/pkg/pwdb"
"pathwar.land/v2/go/pkg/pwinit"
)

func applyDockerConfig(ctx context.Context, apiInstances *pwapi.AgentListInstances_Output, dockerClient *client.Client, opts Opts) error {
Expand Down
8 changes: 4 additions & 4 deletions go/pkg/pwagent/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"go.uber.org/zap"
"golang.org/x/crypto/sha3"
"moul.io/godev"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwapi"
"pathwar.land/go/v2/pkg/pwcompose"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwapi"
"pathwar.land/v2/go/pkg/pwcompose"
"pathwar.land/v2/go/pkg/pwdb"
)

func applyNginxConfig(ctx context.Context, apiInstances *pwapi.AgentListInstances_Output, dockerClient *client.Client, opts Opts) error {
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwagent/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"go.uber.org/zap"
"pathwar.land/go/v2/internal/randstring"
"pathwar.land/v2/go/internal/randstring"
)

type Opts struct {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_agent-list-instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"go.uber.org/zap"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func (svc *service) AgentListInstances(ctx context.Context, in *AgentListInstances_Input) (*AgentListInstances_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_agent-list-instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/internal/testutil"
"pathwar.land/v2/go/pkg/errcode"
)

func TestService_AgentListInstances(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwapi/api_agent-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pwapi
import (
"context"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/pkg/errcode"
)

func (svc *service) AgentList(context.Context, *AgentList_Input) (*AgentList_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_agent-register.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"
"time"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func (svc *service) AgentRegister(ctx context.Context, in *AgentRegister_Input) (*AgentRegister_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_agent-register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/internal/testutil"
"pathwar.land/v2/go/pkg/errcode"
)

func TestService_AgentRegister(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwapi/api_agent-update-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pwapi
import (
"context"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/pkg/errcode"
)

func (svc *service) AgentUpdateState(context.Context, *AgentUpdateState_Input) (*AgentUpdateState_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_challenge-get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package pwapi
import (
"context"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func (svc *service) ChallengeGet(ctx context.Context, in *ChallengeGet_Input) (*ChallengeGet_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_challenge-get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/internal/testutil"
"pathwar.land/v2/go/pkg/errcode"
)

func TestService_ChallengeGet(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/pwapi/api_challenge-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pwapi
import (
"context"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/v2/go/pkg/errcode"
)

func (svc *service) ChallengeList(context.Context, *ChallengeList_Input) (*ChallengeList_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_challenge-subscription-close.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"time"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func (svc *service) ChallengeSubscriptionClose(ctx context.Context, in *ChallengeSubscriptionClose_Input) (*ChallengeSubscriptionClose_Output, error) {
Expand Down
6 changes: 3 additions & 3 deletions go/pkg/pwapi/api_challenge-subscription-close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/internal/testutil"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func TestSvc_ChallengeSubscriptionClose(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_challenge-subscription-validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package pwapi
import (
"context"

"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func (svc *service) ChallengeSubscriptionValidate(ctx context.Context, in *ChallengeSubscriptionValidate_Input) (*ChallengeSubscriptionValidate_Output, error) {
Expand Down
6 changes: 3 additions & 3 deletions go/pkg/pwapi/api_challenge-subscription-validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
"pathwar.land/v2/go/internal/testutil"
"pathwar.land/v2/go/pkg/errcode"
"pathwar.land/v2/go/pkg/pwdb"
)

func TestSvc_ChallengeSubscriptionValidate(t *testing.T) {
Expand Down
Loading

0 comments on commit 2b01d49

Please sign in to comment.