blob: 34e9d7fd1fc9ff611a246e4af0101a98f2bdcd2d [file] [log] [blame]
// Copyright 2016 The LUCI Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0-devel
// protoc v3.12.1
// source: go.chromium.org/luci/grpc/internal/svctool/testdata/test.proto
package test
import prpc "go.chromium.org/luci/grpc/prpc"
import (
context "context"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
sub "go.chromium.org/luci/grpc/internal/svctool/testdata/sub"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// The request message containing the user's name.
type M1 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *M1) Reset() {
*x = M1{}
if protoimpl.UnsafeEnabled {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *M1) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*M1) ProtoMessage() {}
func (x *M1) ProtoReflect() protoreflect.Message {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use M1.ProtoReflect.Descriptor instead.
func (*M1) Descriptor() ([]byte, []int) {
return file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescGZIP(), []int{0}
}
func (x *M1) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response message containing the greetings
type M2 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *M2) Reset() {
*x = M2{}
if protoimpl.UnsafeEnabled {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *M2) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*M2) ProtoMessage() {}
func (x *M2) ProtoReflect() protoreflect.Message {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use M2.ProtoReflect.Descriptor instead.
func (*M2) Descriptor() ([]byte, []int) {
return file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescGZIP(), []int{1}
}
func (x *M2) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type Void struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Void) Reset() {
*x = Void{}
if protoimpl.UnsafeEnabled {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Void) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Void) ProtoMessage() {}
func (x *Void) ProtoReflect() protoreflect.Message {
mi := &file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Void.ProtoReflect.Descriptor instead.
func (*Void) Descriptor() ([]byte, []int) {
return file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescGZIP(), []int{2}
}
var File_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto protoreflect.FileDescriptor
var file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDesc = []byte{
0x0a, 0x3e, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72,
0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x76, 0x63, 0x74, 0x6f, 0x6f, 0x6c, 0x2f, 0x74, 0x65, 0x73,
0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x04, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d,
0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x67, 0x72, 0x70,
0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x76, 0x63, 0x74, 0x6f,
0x6f, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x73, 0x75, 0x62, 0x2f,
0x73, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a, 0x02, 0x4d, 0x31, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x22, 0x1e, 0x0a, 0x02, 0x4d, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x22, 0x06, 0x0a, 0x04, 0x56, 0x6f, 0x69, 0x64, 0x32, 0x1f, 0x0a, 0x02, 0x53, 0x31, 0x12, 0x19,
0x0a, 0x01, 0x4d, 0x12, 0x08, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x31, 0x1a, 0x08, 0x2e,
0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x32, 0x22, 0x00, 0x32, 0x6d, 0x0a, 0x02, 0x53, 0x32, 0x12,
0x1d, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x6f,
0x69, 0x64, 0x1a, 0x08, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x31, 0x22, 0x00, 0x12, 0x1d,
0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x08, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x31, 0x1a,
0x0a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x22, 0x00, 0x12, 0x29, 0x0a,
0x03, 0x49, 0x6d, 0x70, 0x12, 0x08, 0x2e, 0x73, 0x75, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x1a, 0x16,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescOnce sync.Once
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescData = file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDesc
)
func file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescGZIP() []byte {
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescOnce.Do(func() {
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescData)
})
return file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDescData
}
var file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_goTypes = []interface{}{
(*M1)(nil), // 0: test.M1
(*M2)(nil), // 1: test.M2
(*Void)(nil), // 2: test.Void
(*sub.Sub)(nil), // 3: sub.Sub
(*empty.Empty)(nil), // 4: google.protobuf.Empty
}
var file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_depIdxs = []int32{
0, // 0: test.S1.M:input_type -> test.M1
2, // 1: test.S2.Get:input_type -> test.Void
0, // 2: test.S2.Set:input_type -> test.M1
3, // 3: test.S2.Imp:input_type -> sub.Sub
1, // 4: test.S1.M:output_type -> test.M2
0, // 5: test.S2.Get:output_type -> test.M1
2, // 6: test.S2.Set:output_type -> test.Void
4, // 7: test.S2.Imp:output_type -> google.protobuf.Empty
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_init() }
func file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_init() {
if File_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*M1); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*M2); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Void); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 2,
},
GoTypes: file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_goTypes,
DependencyIndexes: file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_depIdxs,
MessageInfos: file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_msgTypes,
}.Build()
File_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto = out.File
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_rawDesc = nil
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_goTypes = nil
file_go_chromium_org_luci_grpc_internal_svctool_testdata_test_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// S1Client is the client API for S1 service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type S1Client interface {
M(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error)
}
type s1PRPCClient struct {
client *prpc.Client
}
func NewS1PRPCClient(client *prpc.Client) S1Client {
return &s1PRPCClient{client}
}
func (c *s1PRPCClient) M(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error) {
out := new(M2)
err := c.client.Call(ctx, "test.S1", "M", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
type s1Client struct {
cc grpc.ClientConnInterface
}
func NewS1Client(cc grpc.ClientConnInterface) S1Client {
return &s1Client{cc}
}
func (c *s1Client) M(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error) {
out := new(M2)
err := c.cc.Invoke(ctx, "/test.S1/M", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// S1Server is the server API for S1 service.
type S1Server interface {
M(context.Context, *M1) (*M2, error)
}
// UnimplementedS1Server can be embedded to have forward compatible implementations.
type UnimplementedS1Server struct {
}
func (*UnimplementedS1Server) M(context.Context, *M1) (*M2, error) {
return nil, status.Errorf(codes.Unimplemented, "method M not implemented")
}
func RegisterS1Server(s prpc.Registrar, srv S1Server) {
s.RegisterService(&_S1_serviceDesc, srv)
}
func _S1_M_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(M1)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(S1Server).M(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/test.S1/M",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(S1Server).M(ctx, req.(*M1))
}
return interceptor(ctx, in, info, handler)
}
var _S1_serviceDesc = grpc.ServiceDesc{
ServiceName: "test.S1",
HandlerType: (*S1Server)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "M",
Handler: _S1_M_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "go.chromium.org/luci/grpc/internal/svctool/testdata/test.proto",
}
// S2Client is the client API for S2 service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type S2Client interface {
Get(ctx context.Context, in *Void, opts ...grpc.CallOption) (*M1, error)
Set(ctx context.Context, in *M1, opts ...grpc.CallOption) (*Void, error)
Imp(ctx context.Context, in *sub.Sub, opts ...grpc.CallOption) (*empty.Empty, error)
}
type s2PRPCClient struct {
client *prpc.Client
}
func NewS2PRPCClient(client *prpc.Client) S2Client {
return &s2PRPCClient{client}
}
func (c *s2PRPCClient) Get(ctx context.Context, in *Void, opts ...grpc.CallOption) (*M1, error) {
out := new(M1)
err := c.client.Call(ctx, "test.S2", "Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *s2PRPCClient) Set(ctx context.Context, in *M1, opts ...grpc.CallOption) (*Void, error) {
out := new(Void)
err := c.client.Call(ctx, "test.S2", "Set", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *s2PRPCClient) Imp(ctx context.Context, in *sub.Sub, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.client.Call(ctx, "test.S2", "Imp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
type s2Client struct {
cc grpc.ClientConnInterface
}
func NewS2Client(cc grpc.ClientConnInterface) S2Client {
return &s2Client{cc}
}
func (c *s2Client) Get(ctx context.Context, in *Void, opts ...grpc.CallOption) (*M1, error) {
out := new(M1)
err := c.cc.Invoke(ctx, "/test.S2/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *s2Client) Set(ctx context.Context, in *M1, opts ...grpc.CallOption) (*Void, error) {
out := new(Void)
err := c.cc.Invoke(ctx, "/test.S2/Set", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *s2Client) Imp(ctx context.Context, in *sub.Sub, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/test.S2/Imp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// S2Server is the server API for S2 service.
type S2Server interface {
Get(context.Context, *Void) (*M1, error)
Set(context.Context, *M1) (*Void, error)
Imp(context.Context, *sub.Sub) (*empty.Empty, error)
}
// UnimplementedS2Server can be embedded to have forward compatible implementations.
type UnimplementedS2Server struct {
}
func (*UnimplementedS2Server) Get(context.Context, *Void) (*M1, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedS2Server) Set(context.Context, *M1) (*Void, error) {
return nil, status.Errorf(codes.Unimplemented, "method Set not implemented")
}
func (*UnimplementedS2Server) Imp(context.Context, *sub.Sub) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Imp not implemented")
}
func RegisterS2Server(s prpc.Registrar, srv S2Server) {
s.RegisterService(&_S2_serviceDesc, srv)
}
func _S2_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Void)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(S2Server).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/test.S2/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(S2Server).Get(ctx, req.(*Void))
}
return interceptor(ctx, in, info, handler)
}
func _S2_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(M1)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(S2Server).Set(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/test.S2/Set",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(S2Server).Set(ctx, req.(*M1))
}
return interceptor(ctx, in, info, handler)
}
func _S2_Imp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sub.Sub)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(S2Server).Imp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/test.S2/Imp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(S2Server).Imp(ctx, req.(*sub.Sub))
}
return interceptor(ctx, in, info, handler)
}
var _S2_serviceDesc = grpc.ServiceDesc{
ServiceName: "test.S2",
HandlerType: (*S2Server)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Get",
Handler: _S2_Get_Handler,
},
{
MethodName: "Set",
Handler: _S2_Set_Handler,
},
{
MethodName: "Imp",
Handler: _S2_Imp_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "go.chromium.org/luci/grpc/internal/svctool/testdata/test.proto",
}