Skip to content

Commit

Permalink
feat: go-mod v2
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 21, 2020
1 parent 360dbec commit 41c4982
Show file tree
Hide file tree
Showing 81 changed files with 147 additions and 143 deletions.
2 changes: 1 addition & 1 deletion api/pwsso.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ message Claims {
string given_name = 5;

ActionToken action_token = 100;
}
}
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.

5 changes: 4 additions & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GOPKG = pathwar.land/go
GOBINS = ./cmd/pathwar ./cmd/pwinit
DOCKER_IMAGE = pathwar/pathwar

GO_INSTALL_OPTS = -v -ldflags "-s -w -X pathwar.land/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"
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"
PRE_INSTALL_STEPS += generate
PRE_UNITTEST_STEPS += generate
PRE_TEST_STEPS += generate
Expand Down Expand Up @@ -94,6 +94,9 @@ 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" \
); done
@### custom
sed -i [email protected]/go/[email protected]/go/v2/pkg@ ./pkg/*/*.pb.go
@### end of custom
goimports -w ./pkg ./cmd ./internal
shasum $(GEN_SRC) | sort > gen.sum.tmp
mv gen.sum.tmp gen.sum
Expand Down
18 changes: 9 additions & 9 deletions go/cmd/pathwar/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main // import "pathwar.land/go/cmd/pathwar"
package main

import (
"context"
Expand All @@ -24,14 +24,14 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/oauth2"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/pkg/pwagent"
"pathwar.land/go/pkg/pwapi"
"pathwar.land/go/pkg/pwcompose"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/pkg/pwinit"
"pathwar.land/go/pkg/pwsso"
"pathwar.land/go/pkg/pwversion"
"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"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions go/cmd/pwinit/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main // import "pathwar.land/go/cmd/pwinit"
package main

import (
"encoding/json"
Expand All @@ -13,8 +13,8 @@ import (
"syscall"

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

func main() {
Expand Down
1 change: 1 addition & 0 deletions go/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package pathwar // import "pathwar.land/go/v2"
4 changes: 2 additions & 2 deletions 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/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module pathwar.land/go
module pathwar.land/go/v2

require (
github.com/Microsoft/go-winio v0.4.14 // indirect
Expand Down
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/internal/randstring"
package randstring // import "pathwar.land/go/v2/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/internal/testutil"
package testutil // import "pathwar.land/go/v2/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/pkg/errcode"
package errcode // import "pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwapi"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwcompose"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/pkg/pwagent"
package pwagent // import "pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwapi"
"pathwar.land/go/pkg/pwcompose"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/pkg/pwinit"
"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"
)

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/pkg/errcode"
"pathwar.land/go/pkg/pwapi"
"pathwar.land/go/pkg/pwcompose"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwapi"
"pathwar.land/go/v2/pkg/pwcompose"
"pathwar.land/go/v2/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/internal/randstring"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
)

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

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

func (svc *service) CouponValidate(ctx context.Context, in *CouponValidate_Input) (*CouponValidate_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_coupon-validate_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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
)

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

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

func (svc *service) OrganizationList(context.Context, *OrganizationList_Input) (*OrganizationList_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_season-challenge-buy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package pwapi
import (
"context"

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

func (svc *service) SeasonChallengeBuy(ctx context.Context, in *SeasonChallengeBuy_Input) (*SeasonChallengeBuy_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_season-challenge-buy_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/internal/testutil"
"pathwar.land/go/pkg/errcode"
"pathwar.land/go/v2/internal/testutil"
"pathwar.land/go/v2/pkg/errcode"
)

func TestSvc_ChallengeBuy(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_season-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/pkg/errcode"
"pathwar.land/go/pkg/pwdb"
"pathwar.land/go/v2/pkg/errcode"
"pathwar.land/go/v2/pkg/pwdb"
)

func (svc *service) SeasonChallengeGet(ctx context.Context, in *SeasonChallengeGet_Input) (*SeasonChallengeGet_Output, error) {
Expand Down
4 changes: 2 additions & 2 deletions go/pkg/pwapi/api_season-challenge-get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

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

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

0 comments on commit 41c4982

Please sign in to comment.