data.pb.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: data.proto
  3. package example
  4. import (
  5. context "context"
  6. fmt "fmt"
  7. proto "github.com/golang/protobuf/proto"
  8. grpc "google.golang.org/grpc"
  9. math "math"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  20. type Data struct {
  21. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
  22. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  23. XXX_unrecognized []byte `json:"-"`
  24. XXX_sizecache int32 `json:"-"`
  25. }
  26. func (m *Data) Reset() { *m = Data{} }
  27. func (m *Data) String() string { return proto.CompactTextString(m) }
  28. func (*Data) ProtoMessage() {}
  29. func (*Data) Descriptor() ([]byte, []int) {
  30. return fileDescriptor_871986018790d2fd, []int{0}
  31. }
  32. func (m *Data) XXX_Unmarshal(b []byte) error {
  33. return xxx_messageInfo_Data.Unmarshal(m, b)
  34. }
  35. func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  36. return xxx_messageInfo_Data.Marshal(b, m, deterministic)
  37. }
  38. func (m *Data) XXX_Merge(src proto.Message) {
  39. xxx_messageInfo_Data.Merge(m, src)
  40. }
  41. func (m *Data) XXX_Size() int {
  42. return xxx_messageInfo_Data.Size(m)
  43. }
  44. func (m *Data) XXX_DiscardUnknown() {
  45. xxx_messageInfo_Data.DiscardUnknown(m)
  46. }
  47. var xxx_messageInfo_Data proto.InternalMessageInfo
  48. func (m *Data) GetText() string {
  49. if m != nil {
  50. return m.Text
  51. }
  52. return ""
  53. }
  54. func init() {
  55. proto.RegisterType((*Data)(nil), "example.Data")
  56. }
  57. func init() { proto.RegisterFile("data.proto", fileDescriptor_871986018790d2fd) }
  58. var fileDescriptor_871986018790d2fd = []byte{
  59. // 106 bytes of a gzipped FileDescriptorProto
  60. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x49, 0x2c, 0x49,
  61. 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x55,
  62. 0x92, 0xe2, 0x62, 0x71, 0x49, 0x2c, 0x49, 0x14, 0x12, 0xe2, 0x62, 0x29, 0x49, 0xad, 0x28, 0x91,
  63. 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x8d, 0x2c, 0xb8, 0xb8, 0xdc, 0xf2, 0x8b, 0x72,
  64. 0x13, 0x4b, 0xc0, 0x2a, 0xb4, 0xb8, 0x38, 0x5c, 0xf2, 0x21, 0x7c, 0x21, 0x5e, 0x3d, 0xa8, 0x7e,
  65. 0x3d, 0x90, 0x94, 0x14, 0x2a, 0x57, 0x89, 0x21, 0x89, 0x0d, 0x6c, 0x8b, 0x31, 0x20, 0x00, 0x00,
  66. 0xff, 0xff, 0x33, 0xcb, 0xa7, 0xd5, 0x73, 0x00, 0x00, 0x00,
  67. }
  68. // Reference imports to suppress errors if they are not otherwise used.
  69. var _ context.Context
  70. var _ grpc.ClientConn
  71. // This is a compile-time assertion to ensure that this generated file
  72. // is compatible with the grpc package it is being compiled against.
  73. const _ = grpc.SupportPackageIsVersion4
  74. // FormatDataClient is the client API for FormatData service.
  75. //
  76. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  77. type FormatDataClient interface {
  78. DoFormat(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error)
  79. }
  80. type formatDataClient struct {
  81. cc *grpc.ClientConn
  82. }
  83. func NewFormatDataClient(cc *grpc.ClientConn) FormatDataClient {
  84. return &formatDataClient{cc}
  85. }
  86. func (c *formatDataClient) DoFormat(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) {
  87. out := new(Data)
  88. err := c.cc.Invoke(ctx, "/example.FormatData/DoFormat", in, out, opts...)
  89. if err != nil {
  90. return nil, err
  91. }
  92. return out, nil
  93. }
  94. // FormatDataServer is the server API for FormatData service.
  95. type FormatDataServer interface {
  96. DoFormat(context.Context, *Data) (*Data, error)
  97. }
  98. func RegisterFormatDataServer(s *grpc.Server, srv FormatDataServer) {
  99. s.RegisterService(&_FormatData_serviceDesc, srv)
  100. }
  101. func _FormatData_DoFormat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  102. in := new(Data)
  103. if err := dec(in); err != nil {
  104. return nil, err
  105. }
  106. if interceptor == nil {
  107. return srv.(FormatDataServer).DoFormat(ctx, in)
  108. }
  109. info := &grpc.UnaryServerInfo{
  110. Server: srv,
  111. FullMethod: "/example.FormatData/DoFormat",
  112. }
  113. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  114. return srv.(FormatDataServer).DoFormat(ctx, req.(*Data))
  115. }
  116. return interceptor(ctx, in, info, handler)
  117. }
  118. var _FormatData_serviceDesc = grpc.ServiceDesc{
  119. ServiceName: "example.FormatData",
  120. HandlerType: (*FormatDataServer)(nil),
  121. Methods: []grpc.MethodDesc{
  122. {
  123. MethodName: "DoFormat",
  124. Handler: _FormatData_DoFormat_Handler,
  125. },
  126. },
  127. Streams: []grpc.StreamDesc{},
  128. Metadata: "data.proto",
  129. }