Created
September 21, 2018 12:18
-
-
Save canberkozcelik/1d438e6e7d09cad3fa656c8322b172df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protoc-gen-go. DO NOT EDIT. | |
// source: grpc_employee.proto | |
package employeebook | |
import proto "github.com/golang/protobuf/proto" | |
import fmt "fmt" | |
import math "math" | |
import ( | |
context "golang.org/x/net/context" | |
grpc "google.golang.org/grpc" | |
) | |
// Reference imports to suppress errors if they are not otherwise used. | |
var _ = proto.Marshal | |
var _ = fmt.Errorf | |
var _ = math.Inf | |
// This is a compile-time assertion to ensure that this generated file | |
// is compatible with the proto package it is being compiled against. | |
// A compilation error at this line likely means your copy of the | |
// proto package needs to be updated. | |
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package | |
type Employee_PhoneType int32 | |
const ( | |
Employee_WORK Employee_PhoneType = 0 | |
Employee_MOBILE Employee_PhoneType = 1 | |
) | |
var Employee_PhoneType_name = map[int32]string{ | |
0: "WORK", | |
1: "MOBILE", | |
} | |
var Employee_PhoneType_value = map[string]int32{ | |
"WORK": 0, | |
"MOBILE": 1, | |
} | |
func (x Employee_PhoneType) Enum() *Employee_PhoneType { | |
p := new(Employee_PhoneType) | |
*p = x | |
return p | |
} | |
func (x Employee_PhoneType) String() string { | |
return proto.EnumName(Employee_PhoneType_name, int32(x)) | |
} | |
func (x *Employee_PhoneType) UnmarshalJSON(data []byte) error { | |
value, err := proto.UnmarshalJSONEnum(Employee_PhoneType_value, data, "Employee_PhoneType") | |
if err != nil { | |
return err | |
} | |
*x = Employee_PhoneType(value) | |
return nil | |
} | |
func (Employee_PhoneType) EnumDescriptor() ([]byte, []int) { | |
return fileDescriptor_025f36791694f5ec, []int{1, 0} | |
} | |
type Key struct { | |
Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` | |
XXX_NoUnkeyedLiteral struct{} `json:"-"` | |
XXX_unrecognized []byte `json:"-"` | |
XXX_sizecache int32 `json:"-"` | |
} | |
func (m *Key) Reset() { *m = Key{} } | |
func (m *Key) String() string { return proto.CompactTextString(m) } | |
func (*Key) ProtoMessage() {} | |
func (*Key) Descriptor() ([]byte, []int) { | |
return fileDescriptor_025f36791694f5ec, []int{0} | |
} | |
func (m *Key) XXX_Unmarshal(b []byte) error { | |
return xxx_messageInfo_Key.Unmarshal(m, b) | |
} | |
func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | |
return xxx_messageInfo_Key.Marshal(b, m, deterministic) | |
} | |
func (m *Key) XXX_Merge(src proto.Message) { | |
xxx_messageInfo_Key.Merge(m, src) | |
} | |
func (m *Key) XXX_Size() int { | |
return xxx_messageInfo_Key.Size(m) | |
} | |
func (m *Key) XXX_DiscardUnknown() { | |
xxx_messageInfo_Key.DiscardUnknown(m) | |
} | |
var xxx_messageInfo_Key proto.InternalMessageInfo | |
func (m *Key) GetKey() string { | |
if m != nil && m.Key != nil { | |
return *m.Key | |
} | |
return "" | |
} | |
type Employee struct { | |
Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` | |
Id *int32 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` | |
Email *string `protobuf:"bytes,3,opt,name=email" json:"email,omitempty"` | |
Position *string `protobuf:"bytes,4,opt,name=position" json:"position,omitempty"` | |
Phones []*Employee_PhoneNumber `protobuf:"bytes,5,rep,name=phones" json:"phones,omitempty"` | |
XXX_NoUnkeyedLiteral struct{} `json:"-"` | |
XXX_unrecognized []byte `json:"-"` | |
XXX_sizecache int32 `json:"-"` | |
} | |
func (m *Employee) Reset() { *m = Employee{} } | |
func (m *Employee) String() string { return proto.CompactTextString(m) } | |
func (*Employee) ProtoMessage() {} | |
func (*Employee) Descriptor() ([]byte, []int) { | |
return fileDescriptor_025f36791694f5ec, []int{1} | |
} | |
func (m *Employee) XXX_Unmarshal(b []byte) error { | |
return xxx_messageInfo_Employee.Unmarshal(m, b) | |
} | |
func (m *Employee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | |
return xxx_messageInfo_Employee.Marshal(b, m, deterministic) | |
} | |
func (m *Employee) XXX_Merge(src proto.Message) { | |
xxx_messageInfo_Employee.Merge(m, src) | |
} | |
func (m *Employee) XXX_Size() int { | |
return xxx_messageInfo_Employee.Size(m) | |
} | |
func (m *Employee) XXX_DiscardUnknown() { | |
xxx_messageInfo_Employee.DiscardUnknown(m) | |
} | |
var xxx_messageInfo_Employee proto.InternalMessageInfo | |
func (m *Employee) GetName() string { | |
if m != nil && m.Name != nil { | |
return *m.Name | |
} | |
return "" | |
} | |
func (m *Employee) GetId() int32 { | |
if m != nil && m.Id != nil { | |
return *m.Id | |
} | |
return 0 | |
} | |
func (m *Employee) GetEmail() string { | |
if m != nil && m.Email != nil { | |
return *m.Email | |
} | |
return "" | |
} | |
func (m *Employee) GetPosition() string { | |
if m != nil && m.Position != nil { | |
return *m.Position | |
} | |
return "" | |
} | |
func (m *Employee) GetPhones() []*Employee_PhoneNumber { | |
if m != nil { | |
return m.Phones | |
} | |
return nil | |
} | |
type Employee_PhoneNumber struct { | |
Number *string `protobuf:"bytes,1,req,name=number" json:"number,omitempty"` | |
Type *Employee_PhoneType `protobuf:"varint,2,opt,name=type,enum=employeebook.Employee_PhoneType,def=0" json:"type,omitempty"` | |
XXX_NoUnkeyedLiteral struct{} `json:"-"` | |
XXX_unrecognized []byte `json:"-"` | |
XXX_sizecache int32 `json:"-"` | |
} | |
func (m *Employee_PhoneNumber) Reset() { *m = Employee_PhoneNumber{} } | |
func (m *Employee_PhoneNumber) String() string { return proto.CompactTextString(m) } | |
func (*Employee_PhoneNumber) ProtoMessage() {} | |
func (*Employee_PhoneNumber) Descriptor() ([]byte, []int) { | |
return fileDescriptor_025f36791694f5ec, []int{1, 0} | |
} | |
func (m *Employee_PhoneNumber) XXX_Unmarshal(b []byte) error { | |
return xxx_messageInfo_Employee_PhoneNumber.Unmarshal(m, b) | |
} | |
func (m *Employee_PhoneNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | |
return xxx_messageInfo_Employee_PhoneNumber.Marshal(b, m, deterministic) | |
} | |
func (m *Employee_PhoneNumber) XXX_Merge(src proto.Message) { | |
xxx_messageInfo_Employee_PhoneNumber.Merge(m, src) | |
} | |
func (m *Employee_PhoneNumber) XXX_Size() int { | |
return xxx_messageInfo_Employee_PhoneNumber.Size(m) | |
} | |
func (m *Employee_PhoneNumber) XXX_DiscardUnknown() { | |
xxx_messageInfo_Employee_PhoneNumber.DiscardUnknown(m) | |
} | |
var xxx_messageInfo_Employee_PhoneNumber proto.InternalMessageInfo | |
const Default_Employee_PhoneNumber_Type Employee_PhoneType = Employee_WORK | |
func (m *Employee_PhoneNumber) GetNumber() string { | |
if m != nil && m.Number != nil { | |
return *m.Number | |
} | |
return "" | |
} | |
func (m *Employee_PhoneNumber) GetType() Employee_PhoneType { | |
if m != nil && m.Type != nil { | |
return *m.Type | |
} | |
return Default_Employee_PhoneNumber_Type | |
} | |
type EmployeeBook struct { | |
Employees []*Employee `protobuf:"bytes,1,rep,name=employees" json:"employees,omitempty"` | |
XXX_NoUnkeyedLiteral struct{} `json:"-"` | |
XXX_unrecognized []byte `json:"-"` | |
XXX_sizecache int32 `json:"-"` | |
} | |
func (m *EmployeeBook) Reset() { *m = EmployeeBook{} } | |
func (m *EmployeeBook) String() string { return proto.CompactTextString(m) } | |
func (*EmployeeBook) ProtoMessage() {} | |
func (*EmployeeBook) Descriptor() ([]byte, []int) { | |
return fileDescriptor_025f36791694f5ec, []int{2} | |
} | |
func (m *EmployeeBook) XXX_Unmarshal(b []byte) error { | |
return xxx_messageInfo_EmployeeBook.Unmarshal(m, b) | |
} | |
func (m *EmployeeBook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | |
return xxx_messageInfo_EmployeeBook.Marshal(b, m, deterministic) | |
} | |
func (m *EmployeeBook) XXX_Merge(src proto.Message) { | |
xxx_messageInfo_EmployeeBook.Merge(m, src) | |
} | |
func (m *EmployeeBook) XXX_Size() int { | |
return xxx_messageInfo_EmployeeBook.Size(m) | |
} | |
func (m *EmployeeBook) XXX_DiscardUnknown() { | |
xxx_messageInfo_EmployeeBook.DiscardUnknown(m) | |
} | |
var xxx_messageInfo_EmployeeBook proto.InternalMessageInfo | |
func (m *EmployeeBook) GetEmployees() []*Employee { | |
if m != nil { | |
return m.Employees | |
} | |
return nil | |
} | |
func init() { | |
proto.RegisterType((*Key)(nil), "employeebook.Key") | |
proto.RegisterType((*Employee)(nil), "employeebook.Employee") | |
proto.RegisterType((*Employee_PhoneNumber)(nil), "employeebook.Employee.PhoneNumber") | |
proto.RegisterType((*EmployeeBook)(nil), "employeebook.EmployeeBook") | |
proto.RegisterEnum("employeebook.Employee_PhoneType", Employee_PhoneType_name, Employee_PhoneType_value) | |
} | |
// Reference imports to suppress errors if they are not otherwise used. | |
var _ context.Context | |
var _ grpc.ClientConn | |
// 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.SupportPackageIsVersion4 | |
// EmployeeServiceClient is the client API for EmployeeService service. | |
// | |
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. | |
type EmployeeServiceClient interface { | |
// Get all employees | |
GetEmployees(ctx context.Context, in *Key, opts ...grpc.CallOption) (EmployeeService_GetEmployeesClient, error) | |
} | |
type employeeServiceClient struct { | |
cc *grpc.ClientConn | |
} | |
func NewEmployeeServiceClient(cc *grpc.ClientConn) EmployeeServiceClient { | |
return &employeeServiceClient{cc} | |
} | |
func (c *employeeServiceClient) GetEmployees(ctx context.Context, in *Key, opts ...grpc.CallOption) (EmployeeService_GetEmployeesClient, error) { | |
stream, err := c.cc.NewStream(ctx, &_EmployeeService_serviceDesc.Streams[0], "/employeebook.EmployeeService/GetEmployees", opts...) | |
if err != nil { | |
return nil, err | |
} | |
x := &employeeServiceGetEmployeesClient{stream} | |
if err := x.ClientStream.SendMsg(in); err != nil { | |
return nil, err | |
} | |
if err := x.ClientStream.CloseSend(); err != nil { | |
return nil, err | |
} | |
return x, nil | |
} | |
type EmployeeService_GetEmployeesClient interface { | |
Recv() (*Employee, error) | |
grpc.ClientStream | |
} | |
type employeeServiceGetEmployeesClient struct { | |
grpc.ClientStream | |
} | |
func (x *employeeServiceGetEmployeesClient) Recv() (*Employee, error) { | |
m := new(Employee) | |
if err := x.ClientStream.RecvMsg(m); err != nil { | |
return nil, err | |
} | |
return m, nil | |
} | |
// EmployeeServiceServer is the server API for EmployeeService service. | |
type EmployeeServiceServer interface { | |
// Get all employees | |
GetEmployees(*Key, EmployeeService_GetEmployeesServer) error | |
} | |
func RegisterEmployeeServiceServer(s *grpc.Server, srv EmployeeServiceServer) { | |
s.RegisterService(&_EmployeeService_serviceDesc, srv) | |
} | |
func _EmployeeService_GetEmployees_Handler(srv interface{}, stream grpc.ServerStream) error { | |
m := new(Key) | |
if err := stream.RecvMsg(m); err != nil { | |
return err | |
} | |
return srv.(EmployeeServiceServer).GetEmployees(m, &employeeServiceGetEmployeesServer{stream}) | |
} | |
type EmployeeService_GetEmployeesServer interface { | |
Send(*Employee) error | |
grpc.ServerStream | |
} | |
type employeeServiceGetEmployeesServer struct { | |
grpc.ServerStream | |
} | |
func (x *employeeServiceGetEmployeesServer) Send(m *Employee) error { | |
return x.ServerStream.SendMsg(m) | |
} | |
var _EmployeeService_serviceDesc = grpc.ServiceDesc{ | |
ServiceName: "employeebook.EmployeeService", | |
HandlerType: (*EmployeeServiceServer)(nil), | |
Methods: []grpc.MethodDesc{}, | |
Streams: []grpc.StreamDesc{ | |
{ | |
StreamName: "GetEmployees", | |
Handler: _EmployeeService_GetEmployees_Handler, | |
ServerStreams: true, | |
}, | |
}, | |
Metadata: "grpc_employee.proto", | |
} | |
func init() { proto.RegisterFile("grpc_employee.proto", fileDescriptor_025f36791694f5ec) } | |
var fileDescriptor_025f36791694f5ec = []byte{ | |
// 325 bytes of a gzipped FileDescriptorProto | |
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x4a, 0xc3, 0x40, | |
0x10, 0x6d, 0x36, 0x69, 0x69, 0xa6, 0xa5, 0xd6, 0xb1, 0xd4, 0xa5, 0xa7, 0x98, 0x53, 0xf0, 0x10, | |
0xa4, 0x78, 0x2a, 0x78, 0x09, 0x16, 0x91, 0xaa, 0x2d, 0xab, 0xe0, 0x51, 0xda, 0x74, 0xd0, 0xd0, | |
0x26, 0xbb, 0x24, 0x51, 0xc8, 0xef, 0xf8, 0xa5, 0xd2, 0x98, 0xad, 0x29, 0xa8, 0xb7, 0x79, 0xf3, | |
0xde, 0xbc, 0xf7, 0x16, 0x16, 0x4e, 0x5e, 0x53, 0x15, 0xbe, 0x50, 0xac, 0xb6, 0xb2, 0x20, 0xf2, | |
0x55, 0x2a, 0x73, 0x89, 0x5d, 0x8d, 0x57, 0x52, 0x6e, 0xdc, 0x53, 0x30, 0x67, 0x54, 0x60, 0x1f, | |
0xcc, 0x0d, 0x15, 0xdc, 0x70, 0x98, 0x67, 0x8b, 0xdd, 0xe8, 0x7e, 0x32, 0x68, 0x4f, 0x2b, 0x25, | |
0x22, 0x58, 0xc9, 0x32, 0xa6, 0x8a, 0x2f, 0x67, 0xec, 0x01, 0x8b, 0xd6, 0x9c, 0x39, 0xcc, 0x6b, | |
0x0a, 0x16, 0xad, 0x71, 0x00, 0x4d, 0x8a, 0x97, 0xd1, 0x96, 0x9b, 0x8e, 0xe1, 0xd9, 0xe2, 0x1b, | |
0xe0, 0x08, 0xda, 0x4a, 0x66, 0x51, 0x1e, 0xc9, 0x84, 0x5b, 0x25, 0xb1, 0xc7, 0x38, 0x81, 0x96, | |
0x7a, 0x93, 0x09, 0x65, 0xbc, 0xe9, 0x98, 0x5e, 0x67, 0xec, 0xfa, 0xf5, 0x6a, 0xbe, 0x4e, 0xf7, | |
0x17, 0x3b, 0xd1, 0xc3, 0x7b, 0xbc, 0xa2, 0x54, 0x54, 0x17, 0xa3, 0x25, 0x74, 0x6a, 0x6b, 0x1c, | |
0x42, 0x2b, 0x29, 0xa7, 0xaa, 0x62, 0x85, 0x70, 0x02, 0x56, 0x5e, 0x28, 0xe2, 0xcc, 0x31, 0xbc, | |
0xde, 0xd8, 0xf9, 0x2f, 0xe0, 0xa9, 0x50, 0x34, 0xb1, 0x9e, 0xe7, 0x62, 0x26, 0xca, 0x1b, 0xf7, | |
0x0c, 0xec, 0x3d, 0x81, 0x6d, 0x28, 0xa9, 0x7e, 0x03, 0x01, 0x5a, 0xf7, 0xf3, 0xe0, 0xf6, 0x6e, | |
0xda, 0x37, 0xdc, 0x6b, 0xe8, 0x6a, 0x93, 0x40, 0xca, 0x0d, 0x5e, 0x82, 0xad, 0x13, 0x32, 0x6e, | |
0x94, 0x8f, 0x1a, 0xfe, 0x9e, 0x29, 0x7e, 0x84, 0xe3, 0x05, 0x1c, 0xe9, 0xf5, 0x23, 0xa5, 0x1f, | |
0x51, 0x48, 0x78, 0x05, 0xdd, 0x1b, 0xca, 0xf5, 0x36, 0xc3, 0xe3, 0x43, 0x97, 0x19, 0x15, 0xa3, | |
0x3f, 0x8c, 0xdd, 0xc6, 0x85, 0x11, 0x9c, 0xc3, 0x20, 0x94, 0xb1, 0x1f, 0x26, 0xab, 0x03, 0x51, | |
0x80, 0xf5, 0xb6, 0x8b, 0xdd, 0x77, 0xc8, 0xbe, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x3b, 0x8a, | |
0xf0, 0x25, 0x02, 0x00, 0x00, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment