github.com/annwntech/go-micro/v2@v2.9.5/api/service/proto/api.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // versions:
     3  // 	protoc-gen-go v1.25.0
     4  // 	protoc        v3.13.0
     5  // source: api/service/proto/api.proto
     6  
     7  package go_micro_api
     8  
     9  import (
    10  	context "context"
    11  	proto "github.com/golang/protobuf/proto"
    12  	grpc "google.golang.org/grpc"
    13  	codes "google.golang.org/grpc/codes"
    14  	status "google.golang.org/grpc/status"
    15  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    16  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    17  	reflect "reflect"
    18  	sync "sync"
    19  )
    20  
    21  const (
    22  	// Verify that this generated code is sufficiently up-to-date.
    23  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    24  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    25  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    26  )
    27  
    28  // This is a compile-time assertion that a sufficiently up-to-date version
    29  // of the legacy proto package is being used.
    30  const _ = proto.ProtoPackageIsVersion4
    31  
    32  type Endpoint struct {
    33  	state         protoimpl.MessageState
    34  	sizeCache     protoimpl.SizeCache
    35  	unknownFields protoimpl.UnknownFields
    36  
    37  	Name   string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    38  	Host   []string `protobuf:"bytes,2,rep,name=host,proto3" json:"host,omitempty"`
    39  	Path   []string `protobuf:"bytes,3,rep,name=path,proto3" json:"path,omitempty"`
    40  	Method []string `protobuf:"bytes,4,rep,name=method,proto3" json:"method,omitempty"`
    41  	Stream bool     `protobuf:"varint,5,opt,name=stream,proto3" json:"stream,omitempty"`
    42  }
    43  
    44  func (x *Endpoint) Reset() {
    45  	*x = Endpoint{}
    46  	if protoimpl.UnsafeEnabled {
    47  		mi := &file_api_service_proto_api_proto_msgTypes[0]
    48  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    49  		ms.StoreMessageInfo(mi)
    50  	}
    51  }
    52  
    53  func (x *Endpoint) String() string {
    54  	return protoimpl.X.MessageStringOf(x)
    55  }
    56  
    57  func (*Endpoint) ProtoMessage() {}
    58  
    59  func (x *Endpoint) ProtoReflect() protoreflect.Message {
    60  	mi := &file_api_service_proto_api_proto_msgTypes[0]
    61  	if protoimpl.UnsafeEnabled && x != nil {
    62  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    63  		if ms.LoadMessageInfo() == nil {
    64  			ms.StoreMessageInfo(mi)
    65  		}
    66  		return ms
    67  	}
    68  	return mi.MessageOf(x)
    69  }
    70  
    71  // Deprecated: Use Endpoint.ProtoReflect.Descriptor instead.
    72  func (*Endpoint) Descriptor() ([]byte, []int) {
    73  	return file_api_service_proto_api_proto_rawDescGZIP(), []int{0}
    74  }
    75  
    76  func (x *Endpoint) GetName() string {
    77  	if x != nil {
    78  		return x.Name
    79  	}
    80  	return ""
    81  }
    82  
    83  func (x *Endpoint) GetHost() []string {
    84  	if x != nil {
    85  		return x.Host
    86  	}
    87  	return nil
    88  }
    89  
    90  func (x *Endpoint) GetPath() []string {
    91  	if x != nil {
    92  		return x.Path
    93  	}
    94  	return nil
    95  }
    96  
    97  func (x *Endpoint) GetMethod() []string {
    98  	if x != nil {
    99  		return x.Method
   100  	}
   101  	return nil
   102  }
   103  
   104  func (x *Endpoint) GetStream() bool {
   105  	if x != nil {
   106  		return x.Stream
   107  	}
   108  	return false
   109  }
   110  
   111  type EmptyResponse struct {
   112  	state         protoimpl.MessageState
   113  	sizeCache     protoimpl.SizeCache
   114  	unknownFields protoimpl.UnknownFields
   115  }
   116  
   117  func (x *EmptyResponse) Reset() {
   118  	*x = EmptyResponse{}
   119  	if protoimpl.UnsafeEnabled {
   120  		mi := &file_api_service_proto_api_proto_msgTypes[1]
   121  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   122  		ms.StoreMessageInfo(mi)
   123  	}
   124  }
   125  
   126  func (x *EmptyResponse) String() string {
   127  	return protoimpl.X.MessageStringOf(x)
   128  }
   129  
   130  func (*EmptyResponse) ProtoMessage() {}
   131  
   132  func (x *EmptyResponse) ProtoReflect() protoreflect.Message {
   133  	mi := &file_api_service_proto_api_proto_msgTypes[1]
   134  	if protoimpl.UnsafeEnabled && x != nil {
   135  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   136  		if ms.LoadMessageInfo() == nil {
   137  			ms.StoreMessageInfo(mi)
   138  		}
   139  		return ms
   140  	}
   141  	return mi.MessageOf(x)
   142  }
   143  
   144  // Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.
   145  func (*EmptyResponse) Descriptor() ([]byte, []int) {
   146  	return file_api_service_proto_api_proto_rawDescGZIP(), []int{1}
   147  }
   148  
   149  var File_api_service_proto_api_proto protoreflect.FileDescriptor
   150  
   151  var file_api_service_proto_api_proto_rawDesc = []byte{
   152  	0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x72,
   153  	0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67,
   154  	0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x76, 0x0a, 0x08, 0x45,
   155  	0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
   156  	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68,
   157  	0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12,
   158  	0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x70,
   159  	0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20,
   160  	0x03, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73,
   161  	0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x72,
   162  	0x65, 0x61, 0x6d, 0x22, 0x0f, 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70,
   163  	0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8d, 0x01, 0x0a, 0x03, 0x41, 0x70, 0x69, 0x12, 0x41, 0x0a, 0x08,
   164  	0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69,
   165  	0x63, 0x72, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,
   166  	0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e,
   167  	0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
   168  	0x43, 0x0a, 0x0a, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e,
   169  	0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x64,
   170  	0x70, 0x6f, 0x69, 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f,
   171  	0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
   172  	0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   173  }
   174  
   175  var (
   176  	file_api_service_proto_api_proto_rawDescOnce sync.Once
   177  	file_api_service_proto_api_proto_rawDescData = file_api_service_proto_api_proto_rawDesc
   178  )
   179  
   180  func file_api_service_proto_api_proto_rawDescGZIP() []byte {
   181  	file_api_service_proto_api_proto_rawDescOnce.Do(func() {
   182  		file_api_service_proto_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_service_proto_api_proto_rawDescData)
   183  	})
   184  	return file_api_service_proto_api_proto_rawDescData
   185  }
   186  
   187  var file_api_service_proto_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   188  var file_api_service_proto_api_proto_goTypes = []interface{}{
   189  	(*Endpoint)(nil),      // 0: go.micro.api.Endpoint
   190  	(*EmptyResponse)(nil), // 1: go.micro.api.EmptyResponse
   191  }
   192  var file_api_service_proto_api_proto_depIdxs = []int32{
   193  	0, // 0: go.micro.api.Api.Register:input_type -> go.micro.api.Endpoint
   194  	0, // 1: go.micro.api.Api.Deregister:input_type -> go.micro.api.Endpoint
   195  	1, // 2: go.micro.api.Api.Register:output_type -> go.micro.api.EmptyResponse
   196  	1, // 3: go.micro.api.Api.Deregister:output_type -> go.micro.api.EmptyResponse
   197  	2, // [2:4] is the sub-list for method output_type
   198  	0, // [0:2] is the sub-list for method input_type
   199  	0, // [0:0] is the sub-list for extension type_name
   200  	0, // [0:0] is the sub-list for extension extendee
   201  	0, // [0:0] is the sub-list for field type_name
   202  }
   203  
   204  func init() { file_api_service_proto_api_proto_init() }
   205  func file_api_service_proto_api_proto_init() {
   206  	if File_api_service_proto_api_proto != nil {
   207  		return
   208  	}
   209  	if !protoimpl.UnsafeEnabled {
   210  		file_api_service_proto_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   211  			switch v := v.(*Endpoint); i {
   212  			case 0:
   213  				return &v.state
   214  			case 1:
   215  				return &v.sizeCache
   216  			case 2:
   217  				return &v.unknownFields
   218  			default:
   219  				return nil
   220  			}
   221  		}
   222  		file_api_service_proto_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   223  			switch v := v.(*EmptyResponse); i {
   224  			case 0:
   225  				return &v.state
   226  			case 1:
   227  				return &v.sizeCache
   228  			case 2:
   229  				return &v.unknownFields
   230  			default:
   231  				return nil
   232  			}
   233  		}
   234  	}
   235  	type x struct{}
   236  	out := protoimpl.TypeBuilder{
   237  		File: protoimpl.DescBuilder{
   238  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   239  			RawDescriptor: file_api_service_proto_api_proto_rawDesc,
   240  			NumEnums:      0,
   241  			NumMessages:   2,
   242  			NumExtensions: 0,
   243  			NumServices:   1,
   244  		},
   245  		GoTypes:           file_api_service_proto_api_proto_goTypes,
   246  		DependencyIndexes: file_api_service_proto_api_proto_depIdxs,
   247  		MessageInfos:      file_api_service_proto_api_proto_msgTypes,
   248  	}.Build()
   249  	File_api_service_proto_api_proto = out.File
   250  	file_api_service_proto_api_proto_rawDesc = nil
   251  	file_api_service_proto_api_proto_goTypes = nil
   252  	file_api_service_proto_api_proto_depIdxs = nil
   253  }
   254  
   255  // Reference imports to suppress errors if they are not otherwise used.
   256  var _ context.Context
   257  var _ grpc.ClientConnInterface
   258  
   259  // This is a compile-time assertion to ensure that this generated file
   260  // is compatible with the grpc package it is being compiled against.
   261  const _ = grpc.SupportPackageIsVersion6
   262  
   263  // ApiClient is the client API for Api service.
   264  //
   265  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   266  type ApiClient interface {
   267  	Register(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error)
   268  	Deregister(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error)
   269  }
   270  
   271  type apiClient struct {
   272  	cc grpc.ClientConnInterface
   273  }
   274  
   275  func NewApiClient(cc grpc.ClientConnInterface) ApiClient {
   276  	return &apiClient{cc}
   277  }
   278  
   279  func (c *apiClient) Register(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error) {
   280  	out := new(EmptyResponse)
   281  	err := c.cc.Invoke(ctx, "/go.micro.api.Api/Register", in, out, opts...)
   282  	if err != nil {
   283  		return nil, err
   284  	}
   285  	return out, nil
   286  }
   287  
   288  func (c *apiClient) Deregister(ctx context.Context, in *Endpoint, opts ...grpc.CallOption) (*EmptyResponse, error) {
   289  	out := new(EmptyResponse)
   290  	err := c.cc.Invoke(ctx, "/go.micro.api.Api/Deregister", in, out, opts...)
   291  	if err != nil {
   292  		return nil, err
   293  	}
   294  	return out, nil
   295  }
   296  
   297  // ApiServer is the server API for Api service.
   298  type ApiServer interface {
   299  	Register(context.Context, *Endpoint) (*EmptyResponse, error)
   300  	Deregister(context.Context, *Endpoint) (*EmptyResponse, error)
   301  }
   302  
   303  // UnimplementedApiServer can be embedded to have forward compatible implementations.
   304  type UnimplementedApiServer struct {
   305  }
   306  
   307  func (*UnimplementedApiServer) Register(context.Context, *Endpoint) (*EmptyResponse, error) {
   308  	return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
   309  }
   310  func (*UnimplementedApiServer) Deregister(context.Context, *Endpoint) (*EmptyResponse, error) {
   311  	return nil, status.Errorf(codes.Unimplemented, "method Deregister not implemented")
   312  }
   313  
   314  func RegisterApiServer(s *grpc.Server, srv ApiServer) {
   315  	s.RegisterService(&_Api_serviceDesc, srv)
   316  }
   317  
   318  func _Api_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   319  	in := new(Endpoint)
   320  	if err := dec(in); err != nil {
   321  		return nil, err
   322  	}
   323  	if interceptor == nil {
   324  		return srv.(ApiServer).Register(ctx, in)
   325  	}
   326  	info := &grpc.UnaryServerInfo{
   327  		Server:     srv,
   328  		FullMethod: "/go.micro.api.Api/Register",
   329  	}
   330  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   331  		return srv.(ApiServer).Register(ctx, req.(*Endpoint))
   332  	}
   333  	return interceptor(ctx, in, info, handler)
   334  }
   335  
   336  func _Api_Deregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   337  	in := new(Endpoint)
   338  	if err := dec(in); err != nil {
   339  		return nil, err
   340  	}
   341  	if interceptor == nil {
   342  		return srv.(ApiServer).Deregister(ctx, in)
   343  	}
   344  	info := &grpc.UnaryServerInfo{
   345  		Server:     srv,
   346  		FullMethod: "/go.micro.api.Api/Deregister",
   347  	}
   348  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   349  		return srv.(ApiServer).Deregister(ctx, req.(*Endpoint))
   350  	}
   351  	return interceptor(ctx, in, info, handler)
   352  }
   353  
   354  var _Api_serviceDesc = grpc.ServiceDesc{
   355  	ServiceName: "go.micro.api.Api",
   356  	HandlerType: (*ApiServer)(nil),
   357  	Methods: []grpc.MethodDesc{
   358  		{
   359  			MethodName: "Register",
   360  			Handler:    _Api_Register_Handler,
   361  		},
   362  		{
   363  			MethodName: "Deregister",
   364  			Handler:    _Api_Deregister_Handler,
   365  		},
   366  	},
   367  	Streams:  []grpc.StreamDesc{},
   368  	Metadata: "api/service/proto/api.proto",
   369  }