chore: switch to moul.io/protoc-gen-gotemplate

This commit is contained in:
Manfred Touron
2018-09-12 20:29:07 +02:00
parent ac2e25e74f
commit c015ff9539
34 changed files with 74 additions and 73 deletions

View File

@@ -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:

View File

@@ -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() {

View File

@@ -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 {

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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

View File

@@ -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{}

View File

@@ -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 {

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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

View File

@@ -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{}

View File

@@ -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 {

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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

View File

@@ -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{}

View File

@@ -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;

View File

@@ -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

View File

@@ -17,7 +17,7 @@ package article
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import common "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common"
import common "moul.io/protoc-gen-gotemplate/examples/import/output/models/common"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal

View File

@@ -2,8 +2,8 @@
package company
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 {
@@ -37,4 +37,4 @@ func (sdk *Sdk) GetArticle(ctx context.Context,
}

View File

@@ -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 {
@@ -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 */}}

View File

@@ -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

View File

@@ -17,7 +17,7 @@ package bbb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import the_aaa_package "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"
import the_aaa_package "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"
import (
context "golang.org/x/net/context"

View File

@@ -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"
)

View File

@@ -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;
@@ -9,4 +9,4 @@ message AaaRequest {
}
message AaaReply {
string error = 1;
}
}

View File

@@ -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";
@@ -16,4 +16,4 @@ message BbbRequest {
}
message BbbReply {
bool done = 1;
}
}