Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-twirp_ruby: obey ruby_package #35

Merged
merged 2 commits into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions Gopkg.lock

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

42 changes: 42 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/golang/protobuf"
version = "1.3.1"

[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.1"

[[constraint]]
name = "github.com/stretchr/testify"
version = "1.3.0"

[prune]
go-tests = true
unused-packages = true
Binary file added internal/gen/typemap/testdata/fileset.pb
Binary file not shown.
16 changes: 16 additions & 0 deletions internal/gen/typemap/testdata/gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2018 Twitch Interactive, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may not
// use this file except in compliance with the License. A copy of the License is
// located at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// or in the "license" file accompanying this file. This file is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

package testdata

//go:generate protoc --descriptor_set_out=fileset.pb --include_imports --include_source_info ./service.proto
11 changes: 11 additions & 0 deletions internal/gen/typemap/testdata/importer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";

package twirp.internal.gen.typemap.testdata.importer;

import "root_pkg.proto";

message ImporterMsg {
root_pkg.RootMsg a = 1;

message ImporterInner {}
}
14 changes: 14 additions & 0 deletions internal/gen/typemap/testdata/public_importer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";

package twirp.internal.gen.typemap.testdata.public_importer;

import public "root_pkg.proto";
import public "importer.proto";

message PublicImporterMsgA {
importer.ImporterMsg a = 1;
}

message PublicImporterMsgB {
root_pkg.RootMsg a = 1;
}
12 changes: 12 additions & 0 deletions internal/gen/typemap/testdata/public_reimporter.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

package twirp.internal.gen.typemap.testdata.public_reimporter;

import public "public_importer.proto";

message PublicReimporterMsg {
public_importer.PublicImporterMsgA a = 1;
public_importer.PublicImporterMsgB b = 2;
root_pkg.RootMsg c = 3;
importer.ImporterMsg d = 4;
}
6 changes: 6 additions & 0 deletions internal/gen/typemap/testdata/root_pkg.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
syntax = "proto3";

package twirp.internal.gen.typemap.testdata.root_pkg;

// RootMsg leading
message RootMsg {}
37 changes: 37 additions & 0 deletions internal/gen/typemap/testdata/service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package twirp.internal.gen.typemap.testdata.public_reimporter;

import public "public_reimporter.proto";

message ServiceMsg {
public_importer.PublicImporterMsgA a = 1;
public_importer.PublicImporterMsgB b = 2;
root_pkg.RootMsg c = 3;
importer.ImporterMsg d = 4;
}

message Parent {
message NestedOuter{
message NestedInner{}
}
}

service EmptyService {}

service ServiceWithOneMethod{
// Method1 leading
rpc Method1(root_pkg.RootMsg) returns (importer.ImporterMsg);
// Method1 trailing
}

// ServiceWithManyMethods leading
service ServiceWithManyMethods{
// Method1 leading
rpc Method1(root_pkg.RootMsg) returns (importer.ImporterMsg);
// Method2 leading
rpc Method2(Parent) returns (Parent.NestedOuter);
// Method2 trailing

rpc Method3(importer.ImporterMsg.ImporterInner) returns (Parent.NestedOuter.NestedInner);
}
Loading