diff --git a/README.md b/README.md index b246e57..0ab35d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ttrpc -[![Build Status](https://travis-ci.org/stevvooe/ttrpc.svg?branch=master)](https://travis-ci.org/stevvooe/ttrpc) +[![Build Status](https://travis-ci.org/containerd/ttrpc.svg?branch=master)](https://travis-ci.org/containerd/ttrpc) GRPC for low-memory environments. @@ -25,7 +25,7 @@ Create a gogo vanity binary (see [`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an example with the ttrpc plugin enabled. -It's recommended to use [`protobuild`](https://github.com/stevvooe/protobuild) +It's recommended to use [`protobuild`](https://github.com/containerd/protobuild) to build the protobufs for this project, but this will work with protoc directly, if required. diff --git a/cmd/protoc-gen-gogottrpc/main.go b/cmd/protoc-gen-gogottrpc/main.go index 23e1fcb..d75d9c3 100644 --- a/cmd/protoc-gen-gogottrpc/main.go +++ b/cmd/protoc-gen-gogottrpc/main.go @@ -1,10 +1,10 @@ package main import ( + _ "github.com/containerd/ttrpc/plugin" "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "github.com/gogo/protobuf/vanity" "github.com/gogo/protobuf/vanity/command" - _ "github.com/stevvooe/ttrpc/plugin" ) func main() { diff --git a/Protobuild.toml b/example/Protobuild.toml similarity index 100% rename from Protobuild.toml rename to example/Protobuild.toml diff --git a/example/example.pb.go b/example/example.pb.go index f52108a..7efa7a2 100644 --- a/example/example.pb.go +++ b/example/example.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/stevvooe/ttrpc/example/example.proto +// source: github.com/containerd/ttrpc/example/example.proto /* Package example is a generated protocol buffer package. It is generated from these files: - github.com/stevvooe/ttrpc/example/example.proto + github.com/containerd/ttrpc/example/example.proto It has these top-level messages: Method1Request @@ -24,7 +24,7 @@ import strings "strings" import reflect "reflect" import context "context" -import github_com_stevvooe_ttrpc "github.com/stevvooe/ttrpc" +import ttrpc "github.com/containerd/ttrpc" import io "io" @@ -154,24 +154,6 @@ func (m *Method2Request) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Example(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Example(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} func encodeVarintExample(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -278,8 +260,8 @@ type ExampleService interface { Method2(ctx context.Context, req *Method1Request) (*google_protobuf.Empty, error) } -func RegisterExampleService(srv *github_com_stevvooe_ttrpc.Server, svc ExampleService) { - srv.Register("ttrpc.example.v1.Example", map[string]github_com_stevvooe_ttrpc.Method{ +func RegisterExampleService(srv *ttrpc.Server, svc ExampleService) { + srv.Register("ttrpc.example.v1.Example", map[string]ttrpc.Method{ "Method1": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { var req Method1Request if err := unmarshal(&req); err != nil { @@ -298,10 +280,10 @@ func RegisterExampleService(srv *github_com_stevvooe_ttrpc.Server, svc ExampleSe } type exampleClient struct { - client *github_com_stevvooe_ttrpc.Client + client *ttrpc.Client } -func NewExampleClient(client *github_com_stevvooe_ttrpc.Client) ExampleService { +func NewExampleClient(client *ttrpc.Client) ExampleService { return &exampleClient{ client: client, } @@ -723,27 +705,27 @@ var ( ) func init() { - proto.RegisterFile("github.com/stevvooe/ttrpc/example/example.proto", fileDescriptorExample) + proto.RegisterFile("github.com/containerd/ttrpc/example/example.proto", fileDescriptorExample) } var fileDescriptorExample = []byte{ - // 277 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x2f, 0x2e, 0x49, 0x2d, 0x2b, 0xcb, 0xcf, 0x4f, 0xd5, - 0x2f, 0x29, 0x29, 0x2a, 0x48, 0xd6, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x85, 0xd1, 0x7a, - 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x02, 0x60, 0x49, 0x3d, 0x98, 0x60, 0x99, 0xa1, 0x94, 0x74, - 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x58, 0x3e, 0xa9, 0x34, 0x4d, 0x3f, 0x35, 0xb7, 0xa0, - 0xa4, 0x12, 0xa2, 0x5c, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0x20, 0xa2, - 0x4a, 0x26, 0x5c, 0x7c, 0xbe, 0xa9, 0x25, 0x19, 0xf9, 0x29, 0x86, 0x41, 0xa9, 0x85, 0xa5, 0xa9, - 0xc5, 0x25, 0x42, 0x02, 0x5c, 0xcc, 0x69, 0xf9, 0xf9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, - 0x20, 0x26, 0x48, 0x24, 0x29, 0xb1, 0x48, 0x82, 0x09, 0x22, 0x92, 0x94, 0x58, 0xa4, 0x64, 0xca, - 0xc5, 0x0f, 0xd7, 0x55, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x4a, 0x94, 0x36, 0x0d, 0x98, 0x65, 0x46, - 0x30, 0xcb, 0xc4, 0xb8, 0xd8, 0x12, 0x93, 0x4b, 0x32, 0xf3, 0xf3, 0xa0, 0x1a, 0xa1, 0x3c, 0xa3, - 0x79, 0x8c, 0x5c, 0xec, 0xae, 0x10, 0x8f, 0x09, 0xf9, 0x71, 0xb1, 0x43, 0x2d, 0x13, 0x52, 0xd0, - 0x43, 0xf7, 0xb3, 0x1e, 0xaa, 0xeb, 0xa5, 0x14, 0xf1, 0xa8, 0x80, 0xba, 0xd4, 0x19, 0x66, 0x9e, - 0x11, 0x11, 0xe6, 0x89, 0xe9, 0x41, 0xc2, 0x54, 0x0f, 0x16, 0xa6, 0x7a, 0xae, 0xa0, 0x30, 0x75, - 0x72, 0x3e, 0xf1, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, - 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x26, 0xc1, 0x78, 0xb4, - 0x86, 0xd2, 0x49, 0x6c, 0x60, 0x43, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x52, 0xaa, 0xf2, - 0x1c, 0xfb, 0x01, 0x00, 0x00, + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4c, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, + 0x4a, 0xd1, 0x2f, 0x29, 0x29, 0x2a, 0x48, 0xd6, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x85, + 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x02, 0x60, 0x49, 0x3d, 0x98, 0x60, 0x99, 0xa1, + 0x94, 0x74, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x58, 0x3e, 0xa9, 0x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, 0x93, 0xd8, 0xc0, 0xc6, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4a, + 0xc9, 0x2c, 0xdc, 0xff, 0x01, 0x00, 0x00, } diff --git a/example/example.proto b/example/example.proto index 994c7a6..8584e1c 100644 --- a/example/example.proto +++ b/example/example.proto @@ -5,7 +5,7 @@ package ttrpc.example.v1; import "google/protobuf/empty.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/stevvooe/ttrpc/example;example"; +option go_package = "github.com/containerd/ttrpc/example;example"; service Example { rpc Method1(Method1Request) returns (Method1Response); diff --git a/plugin/generator.go b/plugin/generator.go index 5603e57..e2bb8ea 100644 --- a/plugin/generator.go +++ b/plugin/generator.go @@ -32,7 +32,7 @@ func (p *ttrpcGenerator) Generate(file *generator.FileDescriptor) { p.PluginImports = generator.NewPluginImports(p.Generator) p.contextPkg = p.NewImport("context") p.typeurlPkg = p.NewImport("github.com/containerd/typeurl") - p.ttrpcPkg = p.NewImport("github.com/stevvooe/ttrpc") + p.ttrpcPkg = p.NewImport("github.com/containerd/ttrpc") for _, service := range file.GetService() { serviceName := service.GetName()