Skip to content

Commit

Permalink
chore: switch to moul.io/protoc-gen-gotemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 13, 2018
1 parent ac2e25e commit c015ff9
Show file tree
Hide file tree
Showing 34 changed files with 74 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: go
go: 1.8.x
go: 1.11.x
go_import_path: moul.io/protoc-gen-gotemplate
install:
- go get github.com/Masterminds/glide
- wget https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/master/.travis/install-protoc.sh && chmod +x install-protoc.sh && ./install-protoc.sh 3.4.0
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apk --update add make git go rsync libc-dev \
&& go get -u golang.org/x/tools/cmd/goimports

# Install protoc-gen-gotemplate
COPY . /go/src/github.com/moul/protoc-gen-gotemplate
WORKDIR /go/src/github.com/moul/protoc-gen-gotemplate
COPY . /go/src/moul.io/protoc-gen-gotemplate
WORKDIR /go/src/moul.io/protoc-gen-gotemplate
RUN git remote set-url origin https://github.com/moul/protoc-gen-gotemplate
RUN go install . ./cmd/web-editor
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ See the project helpers for the complete list.

* Install the **Go** compiler and tools from https://golang.org/doc/install
* Install **protobuf**: `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}`
* Install **protoc-gen-gotemplate**: `go get -u github.com/moul/protoc-gen-gotemplate`
* Install **protoc-gen-gotemplate**: `go get -u moul.io/protoc-gen-gotemplate`

## Docker

Expand Down
4 changes: 2 additions & 2 deletions cmd/web-editor/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@
<div class="row">
<div class="col-md-12">
<div>Command: <code>protoc --gotemplate_out=template_dir=.:. example.proto</code></div>
<div>Powered by <a href="https://github.com/moul/protoc-gen-gotemplate">protoc-gen-gotemplate</a></div>
<div>Powered by <a href="https://moul.io/protoc-gen-gotemplate">protoc-gen-gotemplate</a></div>
</div>
</div>
</div>
<a href="https://github.com/moul/protoc-gen-gotemplate"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<a href="https://moul.io/protoc-gen-gotemplate"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
</body>
</html>
2 changes: 1 addition & 1 deletion encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/golang/protobuf/protoc-gen-go/plugin"

pgghelpers "github.com/moul/protoc-gen-gotemplate/helpers"
pgghelpers "moul.io/protoc-gen-gotemplate/helpers"
)

type GenericTemplateBasedEncoder struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/glide.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: github.com/moul/protoc-gen-gotemplate/examples/go-kit
package: moul.io/protoc-gen-gotemplate/examples/go-kit
import:
- package: github.com/go-kit/kit
subpackages:
Expand Down
30 changes: 15 additions & 15 deletions examples/go-kit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ import (
"github.com/gorilla/handlers"
"google.golang.org/grpc"

session_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session"
session_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
session_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
session_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/grpc"
session_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/http"
session_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session"
session_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
session_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
session_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/grpc"
session_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/http"

sprint_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint"
sprint_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
sprint_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
sprint_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/grpc"
sprint_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/http"
sprint_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint"
sprint_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
sprint_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
sprint_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/grpc"
sprint_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/http"

user_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user"
user_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
user_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
user_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/grpc"
user_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/http"
user_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user"
user_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
user_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
user_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/grpc"
user_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/http"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/session/gen/client/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
)

func New(conn *grpc.ClientConn, logger log.Logger) pb.SessionServiceServer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/go-kit/kit/endpoint"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
oldcontext "golang.org/x/net/context"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/session/gen/transports/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
oldcontext "golang.org/x/net/context"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
)

// avoid import errors
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/session/gen/transports/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

gokit_endpoint "github.com/go-kit/kit/endpoint"
httptransport "github.com/go-kit/kit/transport/http"
endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
)

var _ = log.Printf
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/services/session/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"golang.org/x/net/context"

pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb"
)

type Service struct{}
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/sprint/gen/client/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
)

func New(conn *grpc.ClientConn, logger log.Logger) pb.SprintServiceServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/services/sprint/gen/endpoints/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/go-kit/kit/endpoint"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
oldcontext "golang.org/x/net/context"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/sprint/gen/transports/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
oldcontext "golang.org/x/net/context"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
)

// avoid import errors
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/sprint/gen/transports/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

gokit_endpoint "github.com/go-kit/kit/endpoint"
httptransport "github.com/go-kit/kit/transport/http"
endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
)

var _ = log.Printf
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/services/sprint/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"golang.org/x/net/context"

pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
)

type Service struct{}
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/user/gen/client/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
)

func New(conn *grpc.ClientConn, logger log.Logger) pb.UserServiceServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/services/user/gen/endpoints/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/go-kit/kit/endpoint"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
oldcontext "golang.org/x/net/context"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/user/gen/transports/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
grpctransport "github.com/go-kit/kit/transport/grpc"
oldcontext "golang.org/x/net/context"

endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
)

// avoid import errors
Expand Down
4 changes: 2 additions & 2 deletions examples/go-kit/services/user/gen/transports/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

gokit_endpoint "github.com/go-kit/kit/endpoint"
httptransport "github.com/go-kit/kit/transport/http"
endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
)

var _ = log.Printf
Expand Down
2 changes: 1 addition & 1 deletion examples/go-kit/services/user/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"golang.org/x/net/context"

pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb"
)

type Service struct{}
Expand Down
2 changes: 1 addition & 1 deletion examples/helpers/helpers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package dummy;

option go_package = "github.com/moul/protoc-gen-gotemplate/examples/helpers";
option go_package = "moul.io/protoc-gen-gotemplate/examples/helpers";

message Dummy1 {
float aaa = 1;
Expand Down
2 changes: 1 addition & 1 deletion examples/import/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build:
mkdir -p output

# generate pb.go inluding imported proto
protoc --go_out=Mproto/common.proto=github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common:./output proto/article.proto
protoc --go_out=Mproto/common.proto=moul.io/protoc-gen-gotemplate/examples/import/output/models/common:./output proto/article.proto
protoc --go_out=,plugins=grpc:./output proto/common.proto

# build our go file based on our template
Expand Down
2 changes: 1 addition & 1 deletion examples/import/output/models/article/article.pb.go

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

6 changes: 3 additions & 3 deletions examples/import/output/output.go

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

6 changes: 3 additions & 3 deletions examples/import/templates/output.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package {{.File.Package}}

import (
"github.com/moul/protoc-gen-gotemplate/examples/import/output/models/article"
"github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common"
"moul.io/protoc-gen-gotemplate/examples/import/output/models/article"
"moul.io/protoc-gen-gotemplate/examples/import/output/models/common"
)

type Repository interface {
Expand Down Expand Up @@ -38,4 +38,4 @@ func (sdk *Sdk) {{$m.Name}}(ctx context.Context, {{if $t.OneofDecl}} req *{{$pkg
}

{{end}} {{/* streaming ifs */}}
{{end}}{{end}} {{/* range with */}}
{{end}}{{end}} {{/* range with */}}
2 changes: 1 addition & 1 deletion examples/single-package-mode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build:
protoc -I./proto --go_out=plugins=grpc:output proto/aaa/aaa.proto
protoc -I./proto --go_out=plugins=grpc:output proto/bbb/bbb.proto
@rm -rf output/aaa output/bbb
@mv output/github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/* output/
@mv output/moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/* output/
@rm -rf output/github.com

@# protoc-gen-gotemplate
Expand Down
2 changes: 1 addition & 1 deletion examples/single-package-mode/output/bbb/bbb.pb.go

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

2 changes: 1 addition & 1 deletion examples/single-package-mode/output/bbb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package bbb
import (
"fmt"

"github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"
"moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"
"golang.org/x/net/context"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/single-package-mode/proto/aaa/aaa.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa";
option go_package = "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa";

package the.aaa.package;

Expand All @@ -9,4 +9,4 @@ message AaaRequest {
}
message AaaReply {
string error = 1;
}
}
4 changes: 2 additions & 2 deletions examples/single-package-mode/proto/bbb/bbb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package the.bbb.package;

option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/bbb";
option go_package = "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/bbb";

import "aaa/aaa.proto";

Expand All @@ -16,4 +16,4 @@ message BbbRequest {
}
message BbbReply {
bool done = 1;
}
}
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package main // import "moul.io/protoc-gen-gotemplate"

import (
"io/ioutil"
Expand All @@ -11,7 +11,7 @@ import (
"github.com/golang/protobuf/protoc-gen-go/plugin"
ggdescriptor "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor"

pgghelpers "github.com/moul/protoc-gen-gotemplate/helpers"
pgghelpers "moul.io/protoc-gen-gotemplate/helpers"
)

var (
Expand Down
Loading

0 comments on commit c015ff9

Please sign in to comment.