consul-demo/proto/sample.pb.go

309 lines
9.1 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.11.4
// source: proto/sample.proto
package proto
import (
context "context"
proto "github.com/golang/protobuf/proto"
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
type SayRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
Day string `protobuf:"bytes,2,opt,name=day,proto3" json:"day,omitempty"`
}
func (x *SayRequest) Reset() {
*x = SayRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_sample_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SayRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SayRequest) ProtoMessage() {}
func (x *SayRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_sample_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 SayRequest.ProtoReflect.Descriptor instead.
func (*SayRequest) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{0}
}
func (x *SayRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *SayRequest) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
type SayResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Reply string `protobuf:"bytes,1,opt,name=Reply,proto3" json:"Reply,omitempty"`
}
func (x *SayResponse) Reset() {
*x = SayResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_sample_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SayResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SayResponse) ProtoMessage() {}
func (x *SayResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_sample_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 SayResponse.ProtoReflect.Descriptor instead.
func (*SayResponse) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{1}
}
func (x *SayResponse) GetReply() string {
if x != nil {
return x.Reply
}
return ""
}
var File_proto_sample_proto protoreflect.FileDescriptor
var file_proto_sample_proto_rawDesc = []byte{
0x0a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0x32, 0x0a, 0x0a,
0x53, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10,
0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79,
0x22, 0x23, 0x0a, 0x0b, 0x53, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0x37, 0x0a, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x2e,
0x0a, 0x03, 0x53, 0x61, 0x79, 0x12, 0x12, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x53,
0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x2e, 0x53, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09,
0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_proto_sample_proto_rawDescOnce sync.Once
file_proto_sample_proto_rawDescData = file_proto_sample_proto_rawDesc
)
func file_proto_sample_proto_rawDescGZIP() []byte {
file_proto_sample_proto_rawDescOnce.Do(func() {
file_proto_sample_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_sample_proto_rawDescData)
})
return file_proto_sample_proto_rawDescData
}
var file_proto_sample_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_proto_sample_proto_goTypes = []interface{}{
(*SayRequest)(nil), // 0: sample.SayRequest
(*SayResponse)(nil), // 1: sample.SayResponse
}
var file_proto_sample_proto_depIdxs = []int32{
0, // 0: sample.Hello.Say:input_type -> sample.SayRequest
1, // 1: sample.Hello.Say:output_type -> sample.SayResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] 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_proto_sample_proto_init() }
func file_proto_sample_proto_init() {
if File_proto_sample_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_sample_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SayRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_sample_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SayResponse); 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_proto_sample_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_sample_proto_goTypes,
DependencyIndexes: file_proto_sample_proto_depIdxs,
MessageInfos: file_proto_sample_proto_msgTypes,
}.Build()
File_proto_sample_proto = out.File
file_proto_sample_proto_rawDesc = nil
file_proto_sample_proto_goTypes = nil
file_proto_sample_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
// HelloClient is the client API for Hello service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type HelloClient interface {
Say(ctx context.Context, in *SayRequest, opts ...grpc.CallOption) (*SayResponse, error)
}
type helloClient struct {
cc grpc.ClientConnInterface
}
func NewHelloClient(cc grpc.ClientConnInterface) HelloClient {
return &helloClient{cc}
}
func (c *helloClient) Say(ctx context.Context, in *SayRequest, opts ...grpc.CallOption) (*SayResponse, error) {
out := new(SayResponse)
err := c.cc.Invoke(ctx, "/sample.Hello/Say", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HelloServer is the server API for Hello service.
type HelloServer interface {
Say(context.Context, *SayRequest) (*SayResponse, error)
}
// UnimplementedHelloServer can be embedded to have forward compatible implementations.
type UnimplementedHelloServer struct {
}
func (*UnimplementedHelloServer) Say(context.Context, *SayRequest) (*SayResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Say not implemented")
}
func RegisterHelloServer(s *grpc.Server, srv HelloServer) {
s.RegisterService(&_Hello_serviceDesc, srv)
}
func _Hello_Say_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SayRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloServer).Say(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/sample.Hello/Say",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloServer).Say(ctx, req.(*SayRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Hello_serviceDesc = grpc.ServiceDesc{
ServiceName: "sample.Hello",
HandlerType: (*HelloServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Say",
Handler: _Hello_Say_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/sample.proto",
}