1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 20:52:22 +00:00
2018-12-16 12:40:54 +08:00

256 lines
9.1 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: helloworld.proto
package main
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
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 Message struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Message) Reset() { *m = Message{} }
func (m *Message) String() string { return proto.CompactTextString(m) }
func (*Message) ProtoMessage() {}
func (*Message) Descriptor() ([]byte, []int) {
return fileDescriptor_helloworld_ed50fb97dddb84f0, []int{0}
}
func (m *Message) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Message.Unmarshal(m, b)
}
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
}
func (dst *Message) XXX_Merge(src proto.Message) {
xxx_messageInfo_Message.Merge(dst, src)
}
func (m *Message) XXX_Size() int {
return xxx_messageInfo_Message.Size(m)
}
func (m *Message) XXX_DiscardUnknown() {
xxx_messageInfo_Message.DiscardUnknown(m)
}
var xxx_messageInfo_Message proto.InternalMessageInfo
func (m *Message) GetName() string {
if m != nil && m.Name != nil {
return *m.Name
}
return ""
}
type String struct {
Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *String) Reset() { *m = String{} }
func (m *String) String() string { return proto.CompactTextString(m) }
func (*String) ProtoMessage() {}
func (*String) Descriptor() ([]byte, []int) {
return fileDescriptor_helloworld_ed50fb97dddb84f0, []int{1}
}
func (m *String) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_String.Unmarshal(m, b)
}
func (m *String) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_String.Marshal(b, m, deterministic)
}
func (dst *String) XXX_Merge(src proto.Message) {
xxx_messageInfo_String.Merge(dst, src)
}
func (m *String) XXX_Size() int {
return xxx_messageInfo_String.Size(m)
}
func (m *String) XXX_DiscardUnknown() {
xxx_messageInfo_String.DiscardUnknown(m)
}
var xxx_messageInfo_String proto.InternalMessageInfo
func (m *String) GetValue() string {
if m != nil && m.Value != nil {
return *m.Value
}
return ""
}
var E_FileOption = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FileOptions)(nil),
ExtensionType: (*String)(nil),
Field: 50000,
Name: "main.file_option",
Tag: "bytes,50000,opt,name=file_option,json=fileOption",
Filename: "helloworld.proto",
}
var E_MessageOption = &proto.ExtensionDesc{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtensionType: (*String)(nil),
Field: 50000,
Name: "main.message_option",
Tag: "bytes,50000,opt,name=message_option,json=messageOption",
Filename: "helloworld.proto",
}
var E_FiledOption = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FieldOptions)(nil),
ExtensionType: (*String)(nil),
Field: 50000,
Name: "main.filed_option",
Tag: "bytes,50000,opt,name=filed_option,json=filedOption",
Filename: "helloworld.proto",
}
var E_ServiceOption = &proto.ExtensionDesc{
ExtendedType: (*descriptor.ServiceOptions)(nil),
ExtensionType: (*String)(nil),
Field: 50000,
Name: "main.service_option",
Tag: "bytes,50000,opt,name=service_option,json=serviceOption",
Filename: "helloworld.proto",
}
var E_MethodOption = &proto.ExtensionDesc{
ExtendedType: (*descriptor.MethodOptions)(nil),
ExtensionType: (*String)(nil),
Field: 50000,
Name: "main.method_option",
Tag: "bytes,50000,opt,name=method_option,json=methodOption",
Filename: "helloworld.proto",
}
func init() {
proto.RegisterType((*Message)(nil), "main.Message")
proto.RegisterType((*String)(nil), "main.String")
proto.RegisterExtension(E_FileOption)
proto.RegisterExtension(E_MessageOption)
proto.RegisterExtension(E_FiledOption)
proto.RegisterExtension(E_ServiceOption)
proto.RegisterExtension(E_MethodOption)
}
// 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
// HelloServiceClient is the client API for HelloService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type HelloServiceClient interface {
Hello(ctx context.Context, in *String, opts ...grpc.CallOption) (*String, error)
}
type helloServiceClient struct {
cc *grpc.ClientConn
}
func NewHelloServiceClient(cc *grpc.ClientConn) HelloServiceClient {
return &helloServiceClient{cc}
}
func (c *helloServiceClient) Hello(ctx context.Context, in *String, opts ...grpc.CallOption) (*String, error) {
out := new(String)
err := c.cc.Invoke(ctx, "/main.HelloService/Hello", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HelloServiceServer is the server API for HelloService service.
type HelloServiceServer interface {
Hello(context.Context, *String) (*String, error)
}
func RegisterHelloServiceServer(s *grpc.Server, srv HelloServiceServer) {
s.RegisterService(&_HelloService_serviceDesc, srv)
}
func _HelloService_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(String)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloServiceServer).Hello(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/main.HelloService/Hello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloServiceServer).Hello(ctx, req.(*String))
}
return interceptor(ctx, in, info, handler)
}
var _HelloService_serviceDesc = grpc.ServiceDesc{
ServiceName: "main.HelloService",
HandlerType: (*HelloServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Hello",
Handler: _HelloService_Hello_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "helloworld.proto",
}
func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_helloworld_ed50fb97dddb84f0) }
var fileDescriptor_helloworld_ed50fb97dddb84f0 = []byte{
// 325 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x51, 0xcf, 0x4e, 0xc2, 0x30,
0x1c, 0x16, 0x05, 0x8c, 0x3f, 0x86, 0x21, 0x0d, 0xc6, 0x65, 0x2a, 0x36, 0x9c, 0x48, 0x4c, 0x4a,
0xc2, 0x71, 0xde, 0x38, 0x18, 0x2f, 0x44, 0x85, 0xc4, 0xab, 0x99, 0xec, 0xc7, 0x68, 0xd2, 0xae,
0xa4, 0x2d, 0x78, 0xe7, 0xe0, 0x1b, 0xf1, 0x1e, 0x3e, 0x92, 0xd9, 0x3a, 0x10, 0x22, 0xe2, 0xf1,
0x6b, 0xbf, 0x7e, 0xff, 0x0a, 0x8d, 0x29, 0x0a, 0xa1, 0x3e, 0x94, 0x16, 0x31, 0x9b, 0x69, 0x65,
0x15, 0x29, 0xcb, 0x88, 0xa7, 0x01, 0x4d, 0x94, 0x4a, 0x04, 0x76, 0xf3, 0xb3, 0xf7, 0xf9, 0xa4,
0x1b, 0xa3, 0x19, 0x6b, 0x3e, 0xb3, 0x4a, 0x3b, 0x5e, 0xfb, 0x1e, 0x4e, 0x07, 0x68, 0x4c, 0x94,
0x20, 0x09, 0xa0, 0x9c, 0x46, 0x12, 0xfd, 0x12, 0x2d, 0x75, 0xce, 0xfa, 0xd5, 0xe5, 0xca, 0x3f,
0x86, 0xa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