github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/router/router.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: router/router.proto
     3  
     4  package router
     5  
     6  import (
     7  	context "context"
     8  	fmt "fmt"
     9  	proto "github.com/golang/protobuf/proto"
    10  	grpc "google.golang.org/grpc"
    11  	math "math"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  // EventType defines the type of event
    26  type EventType int32
    27  
    28  const (
    29  	EventType_Create EventType = 0
    30  	EventType_Delete EventType = 1
    31  	EventType_Update EventType = 2
    32  )
    33  
    34  var EventType_name = map[int32]string{
    35  	0: "Create",
    36  	1: "Delete",
    37  	2: "Update",
    38  }
    39  
    40  var EventType_value = map[string]int32{
    41  	"Create": 0,
    42  	"Delete": 1,
    43  	"Update": 2,
    44  }
    45  
    46  func (x EventType) String() string {
    47  	return proto.EnumName(EventType_name, int32(x))
    48  }
    49  
    50  func (EventType) EnumDescriptor() ([]byte, []int) {
    51  	return fileDescriptor_7214bc1619ffe283, []int{0}
    52  }
    53  
    54  // Empty request
    55  type ReadRequest struct {
    56  	Service              string   `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
    57  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    58  	XXX_unrecognized     []byte   `json:"-"`
    59  	XXX_sizecache        int32    `json:"-"`
    60  }
    61  
    62  func (m *ReadRequest) Reset()         { *m = ReadRequest{} }
    63  func (m *ReadRequest) String() string { return proto.CompactTextString(m) }
    64  func (*ReadRequest) ProtoMessage()    {}
    65  func (*ReadRequest) Descriptor() ([]byte, []int) {
    66  	return fileDescriptor_7214bc1619ffe283, []int{0}
    67  }
    68  
    69  func (m *ReadRequest) XXX_Unmarshal(b []byte) error {
    70  	return xxx_messageInfo_ReadRequest.Unmarshal(m, b)
    71  }
    72  func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    73  	return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic)
    74  }
    75  func (m *ReadRequest) XXX_Merge(src proto.Message) {
    76  	xxx_messageInfo_ReadRequest.Merge(m, src)
    77  }
    78  func (m *ReadRequest) XXX_Size() int {
    79  	return xxx_messageInfo_ReadRequest.Size(m)
    80  }
    81  func (m *ReadRequest) XXX_DiscardUnknown() {
    82  	xxx_messageInfo_ReadRequest.DiscardUnknown(m)
    83  }
    84  
    85  var xxx_messageInfo_ReadRequest proto.InternalMessageInfo
    86  
    87  func (m *ReadRequest) GetService() string {
    88  	if m != nil {
    89  		return m.Service
    90  	}
    91  	return ""
    92  }
    93  
    94  // Empty response
    95  type ReadResponse struct {
    96  	Routes               []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
    97  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    98  	XXX_unrecognized     []byte   `json:"-"`
    99  	XXX_sizecache        int32    `json:"-"`
   100  }
   101  
   102  func (m *ReadResponse) Reset()         { *m = ReadResponse{} }
   103  func (m *ReadResponse) String() string { return proto.CompactTextString(m) }
   104  func (*ReadResponse) ProtoMessage()    {}
   105  func (*ReadResponse) Descriptor() ([]byte, []int) {
   106  	return fileDescriptor_7214bc1619ffe283, []int{1}
   107  }
   108  
   109  func (m *ReadResponse) XXX_Unmarshal(b []byte) error {
   110  	return xxx_messageInfo_ReadResponse.Unmarshal(m, b)
   111  }
   112  func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   113  	return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic)
   114  }
   115  func (m *ReadResponse) XXX_Merge(src proto.Message) {
   116  	xxx_messageInfo_ReadResponse.Merge(m, src)
   117  }
   118  func (m *ReadResponse) XXX_Size() int {
   119  	return xxx_messageInfo_ReadResponse.Size(m)
   120  }
   121  func (m *ReadResponse) XXX_DiscardUnknown() {
   122  	xxx_messageInfo_ReadResponse.DiscardUnknown(m)
   123  }
   124  
   125  var xxx_messageInfo_ReadResponse proto.InternalMessageInfo
   126  
   127  func (m *ReadResponse) GetRoutes() []*Route {
   128  	if m != nil {
   129  		return m.Routes
   130  	}
   131  	return nil
   132  }
   133  
   134  // LookupRequest is made to Lookup
   135  type LookupRequest struct {
   136  	Service              string         `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
   137  	Options              *LookupOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
   138  	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
   139  	XXX_unrecognized     []byte         `json:"-"`
   140  	XXX_sizecache        int32          `json:"-"`
   141  }
   142  
   143  func (m *LookupRequest) Reset()         { *m = LookupRequest{} }
   144  func (m *LookupRequest) String() string { return proto.CompactTextString(m) }
   145  func (*LookupRequest) ProtoMessage()    {}
   146  func (*LookupRequest) Descriptor() ([]byte, []int) {
   147  	return fileDescriptor_7214bc1619ffe283, []int{2}
   148  }
   149  
   150  func (m *LookupRequest) XXX_Unmarshal(b []byte) error {
   151  	return xxx_messageInfo_LookupRequest.Unmarshal(m, b)
   152  }
   153  func (m *LookupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   154  	return xxx_messageInfo_LookupRequest.Marshal(b, m, deterministic)
   155  }
   156  func (m *LookupRequest) XXX_Merge(src proto.Message) {
   157  	xxx_messageInfo_LookupRequest.Merge(m, src)
   158  }
   159  func (m *LookupRequest) XXX_Size() int {
   160  	return xxx_messageInfo_LookupRequest.Size(m)
   161  }
   162  func (m *LookupRequest) XXX_DiscardUnknown() {
   163  	xxx_messageInfo_LookupRequest.DiscardUnknown(m)
   164  }
   165  
   166  var xxx_messageInfo_LookupRequest proto.InternalMessageInfo
   167  
   168  func (m *LookupRequest) GetService() string {
   169  	if m != nil {
   170  		return m.Service
   171  	}
   172  	return ""
   173  }
   174  
   175  func (m *LookupRequest) GetOptions() *LookupOptions {
   176  	if m != nil {
   177  		return m.Options
   178  	}
   179  	return nil
   180  }
   181  
   182  // LookupResponse is returned by Lookup
   183  type LookupResponse struct {
   184  	Routes               []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
   185  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   186  	XXX_unrecognized     []byte   `json:"-"`
   187  	XXX_sizecache        int32    `json:"-"`
   188  }
   189  
   190  func (m *LookupResponse) Reset()         { *m = LookupResponse{} }
   191  func (m *LookupResponse) String() string { return proto.CompactTextString(m) }
   192  func (*LookupResponse) ProtoMessage()    {}
   193  func (*LookupResponse) Descriptor() ([]byte, []int) {
   194  	return fileDescriptor_7214bc1619ffe283, []int{3}
   195  }
   196  
   197  func (m *LookupResponse) XXX_Unmarshal(b []byte) error {
   198  	return xxx_messageInfo_LookupResponse.Unmarshal(m, b)
   199  }
   200  func (m *LookupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   201  	return xxx_messageInfo_LookupResponse.Marshal(b, m, deterministic)
   202  }
   203  func (m *LookupResponse) XXX_Merge(src proto.Message) {
   204  	xxx_messageInfo_LookupResponse.Merge(m, src)
   205  }
   206  func (m *LookupResponse) XXX_Size() int {
   207  	return xxx_messageInfo_LookupResponse.Size(m)
   208  }
   209  func (m *LookupResponse) XXX_DiscardUnknown() {
   210  	xxx_messageInfo_LookupResponse.DiscardUnknown(m)
   211  }
   212  
   213  var xxx_messageInfo_LookupResponse proto.InternalMessageInfo
   214  
   215  func (m *LookupResponse) GetRoutes() []*Route {
   216  	if m != nil {
   217  		return m.Routes
   218  	}
   219  	return nil
   220  }
   221  
   222  // WatchRequest is made to Watch Router
   223  type WatchRequest struct {
   224  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   225  	XXX_unrecognized     []byte   `json:"-"`
   226  	XXX_sizecache        int32    `json:"-"`
   227  }
   228  
   229  func (m *WatchRequest) Reset()         { *m = WatchRequest{} }
   230  func (m *WatchRequest) String() string { return proto.CompactTextString(m) }
   231  func (*WatchRequest) ProtoMessage()    {}
   232  func (*WatchRequest) Descriptor() ([]byte, []int) {
   233  	return fileDescriptor_7214bc1619ffe283, []int{4}
   234  }
   235  
   236  func (m *WatchRequest) XXX_Unmarshal(b []byte) error {
   237  	return xxx_messageInfo_WatchRequest.Unmarshal(m, b)
   238  }
   239  func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   240  	return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic)
   241  }
   242  func (m *WatchRequest) XXX_Merge(src proto.Message) {
   243  	xxx_messageInfo_WatchRequest.Merge(m, src)
   244  }
   245  func (m *WatchRequest) XXX_Size() int {
   246  	return xxx_messageInfo_WatchRequest.Size(m)
   247  }
   248  func (m *WatchRequest) XXX_DiscardUnknown() {
   249  	xxx_messageInfo_WatchRequest.DiscardUnknown(m)
   250  }
   251  
   252  var xxx_messageInfo_WatchRequest proto.InternalMessageInfo
   253  
   254  // CreateResponse is returned by Create
   255  type CreateResponse struct {
   256  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   257  	XXX_unrecognized     []byte   `json:"-"`
   258  	XXX_sizecache        int32    `json:"-"`
   259  }
   260  
   261  func (m *CreateResponse) Reset()         { *m = CreateResponse{} }
   262  func (m *CreateResponse) String() string { return proto.CompactTextString(m) }
   263  func (*CreateResponse) ProtoMessage()    {}
   264  func (*CreateResponse) Descriptor() ([]byte, []int) {
   265  	return fileDescriptor_7214bc1619ffe283, []int{5}
   266  }
   267  
   268  func (m *CreateResponse) XXX_Unmarshal(b []byte) error {
   269  	return xxx_messageInfo_CreateResponse.Unmarshal(m, b)
   270  }
   271  func (m *CreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   272  	return xxx_messageInfo_CreateResponse.Marshal(b, m, deterministic)
   273  }
   274  func (m *CreateResponse) XXX_Merge(src proto.Message) {
   275  	xxx_messageInfo_CreateResponse.Merge(m, src)
   276  }
   277  func (m *CreateResponse) XXX_Size() int {
   278  	return xxx_messageInfo_CreateResponse.Size(m)
   279  }
   280  func (m *CreateResponse) XXX_DiscardUnknown() {
   281  	xxx_messageInfo_CreateResponse.DiscardUnknown(m)
   282  }
   283  
   284  var xxx_messageInfo_CreateResponse proto.InternalMessageInfo
   285  
   286  // DeleteResponse is returned by Delete
   287  type DeleteResponse struct {
   288  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   289  	XXX_unrecognized     []byte   `json:"-"`
   290  	XXX_sizecache        int32    `json:"-"`
   291  }
   292  
   293  func (m *DeleteResponse) Reset()         { *m = DeleteResponse{} }
   294  func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
   295  func (*DeleteResponse) ProtoMessage()    {}
   296  func (*DeleteResponse) Descriptor() ([]byte, []int) {
   297  	return fileDescriptor_7214bc1619ffe283, []int{6}
   298  }
   299  
   300  func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
   301  	return xxx_messageInfo_DeleteResponse.Unmarshal(m, b)
   302  }
   303  func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   304  	return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic)
   305  }
   306  func (m *DeleteResponse) XXX_Merge(src proto.Message) {
   307  	xxx_messageInfo_DeleteResponse.Merge(m, src)
   308  }
   309  func (m *DeleteResponse) XXX_Size() int {
   310  	return xxx_messageInfo_DeleteResponse.Size(m)
   311  }
   312  func (m *DeleteResponse) XXX_DiscardUnknown() {
   313  	xxx_messageInfo_DeleteResponse.DiscardUnknown(m)
   314  }
   315  
   316  var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
   317  
   318  // UpdateResponse is returned by Update
   319  type UpdateResponse struct {
   320  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   321  	XXX_unrecognized     []byte   `json:"-"`
   322  	XXX_sizecache        int32    `json:"-"`
   323  }
   324  
   325  func (m *UpdateResponse) Reset()         { *m = UpdateResponse{} }
   326  func (m *UpdateResponse) String() string { return proto.CompactTextString(m) }
   327  func (*UpdateResponse) ProtoMessage()    {}
   328  func (*UpdateResponse) Descriptor() ([]byte, []int) {
   329  	return fileDescriptor_7214bc1619ffe283, []int{7}
   330  }
   331  
   332  func (m *UpdateResponse) XXX_Unmarshal(b []byte) error {
   333  	return xxx_messageInfo_UpdateResponse.Unmarshal(m, b)
   334  }
   335  func (m *UpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   336  	return xxx_messageInfo_UpdateResponse.Marshal(b, m, deterministic)
   337  }
   338  func (m *UpdateResponse) XXX_Merge(src proto.Message) {
   339  	xxx_messageInfo_UpdateResponse.Merge(m, src)
   340  }
   341  func (m *UpdateResponse) XXX_Size() int {
   342  	return xxx_messageInfo_UpdateResponse.Size(m)
   343  }
   344  func (m *UpdateResponse) XXX_DiscardUnknown() {
   345  	xxx_messageInfo_UpdateResponse.DiscardUnknown(m)
   346  }
   347  
   348  var xxx_messageInfo_UpdateResponse proto.InternalMessageInfo
   349  
   350  // Event is routing table event
   351  type Event struct {
   352  	// the unique event id
   353  	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
   354  	// type of event
   355  	Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=router.EventType" json:"type,omitempty"`
   356  	// unix timestamp of event
   357  	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
   358  	// service route
   359  	Route                *Route   `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"`
   360  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   361  	XXX_unrecognized     []byte   `json:"-"`
   362  	XXX_sizecache        int32    `json:"-"`
   363  }
   364  
   365  func (m *Event) Reset()         { *m = Event{} }
   366  func (m *Event) String() string { return proto.CompactTextString(m) }
   367  func (*Event) ProtoMessage()    {}
   368  func (*Event) Descriptor() ([]byte, []int) {
   369  	return fileDescriptor_7214bc1619ffe283, []int{8}
   370  }
   371  
   372  func (m *Event) XXX_Unmarshal(b []byte) error {
   373  	return xxx_messageInfo_Event.Unmarshal(m, b)
   374  }
   375  func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   376  	return xxx_messageInfo_Event.Marshal(b, m, deterministic)
   377  }
   378  func (m *Event) XXX_Merge(src proto.Message) {
   379  	xxx_messageInfo_Event.Merge(m, src)
   380  }
   381  func (m *Event) XXX_Size() int {
   382  	return xxx_messageInfo_Event.Size(m)
   383  }
   384  func (m *Event) XXX_DiscardUnknown() {
   385  	xxx_messageInfo_Event.DiscardUnknown(m)
   386  }
   387  
   388  var xxx_messageInfo_Event proto.InternalMessageInfo
   389  
   390  func (m *Event) GetId() string {
   391  	if m != nil {
   392  		return m.Id
   393  	}
   394  	return ""
   395  }
   396  
   397  func (m *Event) GetType() EventType {
   398  	if m != nil {
   399  		return m.Type
   400  	}
   401  	return EventType_Create
   402  }
   403  
   404  func (m *Event) GetTimestamp() int64 {
   405  	if m != nil {
   406  		return m.Timestamp
   407  	}
   408  	return 0
   409  }
   410  
   411  func (m *Event) GetRoute() *Route {
   412  	if m != nil {
   413  		return m.Route
   414  	}
   415  	return nil
   416  }
   417  
   418  // LookupOptions are passed in a LookupRequest
   419  type LookupOptions struct {
   420  	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
   421  	Gateway              string   `protobuf:"bytes,2,opt,name=gateway,proto3" json:"gateway,omitempty"`
   422  	Network              string   `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"`
   423  	Router               string   `protobuf:"bytes,4,opt,name=router,proto3" json:"router,omitempty"`
   424  	Link                 string   `protobuf:"bytes,5,opt,name=link,proto3" json:"link,omitempty"`
   425  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   426  	XXX_unrecognized     []byte   `json:"-"`
   427  	XXX_sizecache        int32    `json:"-"`
   428  }
   429  
   430  func (m *LookupOptions) Reset()         { *m = LookupOptions{} }
   431  func (m *LookupOptions) String() string { return proto.CompactTextString(m) }
   432  func (*LookupOptions) ProtoMessage()    {}
   433  func (*LookupOptions) Descriptor() ([]byte, []int) {
   434  	return fileDescriptor_7214bc1619ffe283, []int{9}
   435  }
   436  
   437  func (m *LookupOptions) XXX_Unmarshal(b []byte) error {
   438  	return xxx_messageInfo_LookupOptions.Unmarshal(m, b)
   439  }
   440  func (m *LookupOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   441  	return xxx_messageInfo_LookupOptions.Marshal(b, m, deterministic)
   442  }
   443  func (m *LookupOptions) XXX_Merge(src proto.Message) {
   444  	xxx_messageInfo_LookupOptions.Merge(m, src)
   445  }
   446  func (m *LookupOptions) XXX_Size() int {
   447  	return xxx_messageInfo_LookupOptions.Size(m)
   448  }
   449  func (m *LookupOptions) XXX_DiscardUnknown() {
   450  	xxx_messageInfo_LookupOptions.DiscardUnknown(m)
   451  }
   452  
   453  var xxx_messageInfo_LookupOptions proto.InternalMessageInfo
   454  
   455  func (m *LookupOptions) GetAddress() string {
   456  	if m != nil {
   457  		return m.Address
   458  	}
   459  	return ""
   460  }
   461  
   462  func (m *LookupOptions) GetGateway() string {
   463  	if m != nil {
   464  		return m.Gateway
   465  	}
   466  	return ""
   467  }
   468  
   469  func (m *LookupOptions) GetNetwork() string {
   470  	if m != nil {
   471  		return m.Network
   472  	}
   473  	return ""
   474  }
   475  
   476  func (m *LookupOptions) GetRouter() string {
   477  	if m != nil {
   478  		return m.Router
   479  	}
   480  	return ""
   481  }
   482  
   483  func (m *LookupOptions) GetLink() string {
   484  	if m != nil {
   485  		return m.Link
   486  	}
   487  	return ""
   488  }
   489  
   490  // Route is a service route
   491  type Route struct {
   492  	// service for the route
   493  	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
   494  	// the address that advertise this route
   495  	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
   496  	// gateway as the next hop
   497  	Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
   498  	// the network for this destination
   499  	Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
   500  	// router if the router id
   501  	Router string `protobuf:"bytes,5,opt,name=router,proto3" json:"router,omitempty"`
   502  	// the network link
   503  	Link string `protobuf:"bytes,6,opt,name=link,proto3" json:"link,omitempty"`
   504  	// the metric / score of this route
   505  	Metric int64 `protobuf:"varint,7,opt,name=metric,proto3" json:"metric,omitempty"`
   506  	// metadata for the route
   507  	Metadata             map[string]string `protobuf:"bytes,8,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   508  	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
   509  	XXX_unrecognized     []byte            `json:"-"`
   510  	XXX_sizecache        int32             `json:"-"`
   511  }
   512  
   513  func (m *Route) Reset()         { *m = Route{} }
   514  func (m *Route) String() string { return proto.CompactTextString(m) }
   515  func (*Route) ProtoMessage()    {}
   516  func (*Route) Descriptor() ([]byte, []int) {
   517  	return fileDescriptor_7214bc1619ffe283, []int{10}
   518  }
   519  
   520  func (m *Route) XXX_Unmarshal(b []byte) error {
   521  	return xxx_messageInfo_Route.Unmarshal(m, b)
   522  }
   523  func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   524  	return xxx_messageInfo_Route.Marshal(b, m, deterministic)
   525  }
   526  func (m *Route) XXX_Merge(src proto.Message) {
   527  	xxx_messageInfo_Route.Merge(m, src)
   528  }
   529  func (m *Route) XXX_Size() int {
   530  	return xxx_messageInfo_Route.Size(m)
   531  }
   532  func (m *Route) XXX_DiscardUnknown() {
   533  	xxx_messageInfo_Route.DiscardUnknown(m)
   534  }
   535  
   536  var xxx_messageInfo_Route proto.InternalMessageInfo
   537  
   538  func (m *Route) GetService() string {
   539  	if m != nil {
   540  		return m.Service
   541  	}
   542  	return ""
   543  }
   544  
   545  func (m *Route) GetAddress() string {
   546  	if m != nil {
   547  		return m.Address
   548  	}
   549  	return ""
   550  }
   551  
   552  func (m *Route) GetGateway() string {
   553  	if m != nil {
   554  		return m.Gateway
   555  	}
   556  	return ""
   557  }
   558  
   559  func (m *Route) GetNetwork() string {
   560  	if m != nil {
   561  		return m.Network
   562  	}
   563  	return ""
   564  }
   565  
   566  func (m *Route) GetRouter() string {
   567  	if m != nil {
   568  		return m.Router
   569  	}
   570  	return ""
   571  }
   572  
   573  func (m *Route) GetLink() string {
   574  	if m != nil {
   575  		return m.Link
   576  	}
   577  	return ""
   578  }
   579  
   580  func (m *Route) GetMetric() int64 {
   581  	if m != nil {
   582  		return m.Metric
   583  	}
   584  	return 0
   585  }
   586  
   587  func (m *Route) GetMetadata() map[string]string {
   588  	if m != nil {
   589  		return m.Metadata
   590  	}
   591  	return nil
   592  }
   593  
   594  func init() {
   595  	proto.RegisterEnum("router.EventType", EventType_name, EventType_value)
   596  	proto.RegisterType((*ReadRequest)(nil), "router.ReadRequest")
   597  	proto.RegisterType((*ReadResponse)(nil), "router.ReadResponse")
   598  	proto.RegisterType((*LookupRequest)(nil), "router.LookupRequest")
   599  	proto.RegisterType((*LookupResponse)(nil), "router.LookupResponse")
   600  	proto.RegisterType((*WatchRequest)(nil), "router.WatchRequest")
   601  	proto.RegisterType((*CreateResponse)(nil), "router.CreateResponse")
   602  	proto.RegisterType((*DeleteResponse)(nil), "router.DeleteResponse")
   603  	proto.RegisterType((*UpdateResponse)(nil), "router.UpdateResponse")
   604  	proto.RegisterType((*Event)(nil), "router.Event")
   605  	proto.RegisterType((*LookupOptions)(nil), "router.LookupOptions")
   606  	proto.RegisterType((*Route)(nil), "router.Route")
   607  	proto.RegisterMapType((map[string]string)(nil), "router.Route.MetadataEntry")
   608  }
   609  
   610  func init() { proto.RegisterFile("router/router.proto", fileDescriptor_7214bc1619ffe283) }
   611  
   612  var fileDescriptor_7214bc1619ffe283 = []byte{
   613  	// 589 bytes of a gzipped FileDescriptorProto
   614  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcb, 0x6e, 0xd3, 0x4c,
   615  	0x14, 0x8e, 0x9d, 0xd8, 0xad, 0x4f, 0x9b, 0x28, 0xff, 0xb4, 0x7f, 0x65, 0x05, 0x16, 0x91, 0x51,
   616  	0x45, 0x84, 0x44, 0x5c, 0x12, 0xa1, 0x02, 0xdd, 0x01, 0xdd, 0x81, 0x90, 0x46, 0x45, 0x48, 0xdd,
   617  	0x4d, 0xe2, 0xa3, 0xd6, 0x4a, 0x7c, 0x61, 0x3c, 0x4e, 0x95, 0x25, 0x4b, 0x1e, 0x85, 0x07, 0xe2,
   618  	0x7d, 0x90, 0xe7, 0x92, 0xc4, 0x16, 0x01, 0xb1, 0xc9, 0xcc, 0xb9, 0xe6, 0x3b, 0x9f, 0xbf, 0x33,
   619  	0x70, 0xc2, 0xb3, 0x52, 0x20, 0x0f, 0xd5, 0x31, 0xce, 0x79, 0x26, 0x32, 0xe2, 0x2a, 0x2b, 0x78,
   620  	0x0a, 0x47, 0x14, 0x59, 0x44, 0xf1, 0x6b, 0x89, 0x85, 0x20, 0x3e, 0x1c, 0x14, 0xc8, 0x57, 0xf1,
   621  	0x1c, 0x7d, 0x6b, 0x68, 0x8d, 0x3c, 0x6a, 0xcc, 0xe0, 0x25, 0x1c, 0xab, 0xc4, 0x22, 0xcf, 0xd2,
   622  	0x02, 0xc9, 0x39, 0xa8, 0x16, 0x85, 0x6f, 0x0d, 0xdb, 0xa3, 0xa3, 0x49, 0x77, 0xac, 0xfb, 0xd3,
   623  	0xea, 0xa0, 0x3a, 0x18, 0xdc, 0x42, 0xf7, 0x43, 0x96, 0x2d, 0xca, 0xfc, 0xaf, 0xff, 0x40, 0x42,
   624  	0x38, 0xc8, 0x72, 0x11, 0x67, 0x69, 0xe1, 0xdb, 0x43, 0x6b, 0x74, 0x34, 0xf9, 0xdf, 0xb4, 0x54,
   625  	0x1d, 0x3e, 0xa9, 0x20, 0x35, 0x59, 0xc1, 0x25, 0xf4, 0x4c, 0xef, 0x7f, 0x03, 0xd5, 0x83, 0xe3,
   626  	0x2f, 0x4c, 0xcc, 0xef, 0x35, 0xa6, 0xa0, 0x0f, 0xbd, 0x77, 0x1c, 0x99, 0x40, 0xd3, 0xa8, 0xf2,
   627  	0xbc, 0xc7, 0x25, 0xd6, 0x3d, 0x9f, 0xf3, 0x68, 0x37, 0xe7, 0x9b, 0x05, 0xce, 0xf5, 0x0a, 0x53,
   628  	0x41, 0x7a, 0x60, 0xc7, 0x91, 0x1e, 0xc7, 0x8e, 0x23, 0x72, 0x0e, 0x1d, 0xb1, 0xce, 0x51, 0x8e,
   629  	0xd1, 0x9b, 0xfc, 0x67, 0x40, 0xc8, 0xe4, 0x9b, 0x75, 0x8e, 0x54, 0x86, 0xc9, 0x63, 0xf0, 0x44,
   630  	0x9c, 0x60, 0x21, 0x58, 0x92, 0xfb, 0xed, 0xa1, 0x35, 0x6a, 0xd3, 0xad, 0x83, 0x3c, 0x01, 0x47,
   631  	0xd6, 0xf9, 0x1d, 0x49, 0x46, 0x63, 0x14, 0x15, 0x0b, 0xbe, 0x5b, 0x86, 0x5f, 0xcd, 0x4e, 0xc5,
   632  	0x2f, 0x8b, 0x22, 0x8e, 0x45, 0x61, 0xf8, 0xd5, 0x66, 0x15, 0xb9, 0x63, 0x02, 0x1f, 0xd8, 0x5a,
   633  	0x02, 0xf3, 0xa8, 0x31, 0xab, 0x48, 0x8a, 0xe2, 0x21, 0xe3, 0x0b, 0x09, 0xc3, 0xa3, 0xc6, 0x24,
   634  	0x67, 0x9a, 0x50, 0x2e, 0x51, 0x78, 0x9a, 0x41, 0x4e, 0x08, 0x74, 0x96, 0x71, 0xba, 0xf0, 0x1d,
   635  	0xe9, 0x95, 0xf7, 0xe0, 0x87, 0x0d, 0x8e, 0x04, 0xf7, 0x87, 0x6f, 0xbc, 0x83, 0xce, 0xde, 0x8b,
   636  	0xae, 0xbd, 0x17, 0x5d, 0x67, 0x1f, 0x3a, 0xe7, 0xb7, 0xe8, 0xdc, 0x2d, 0xba, 0x2a, 0x37, 0x41,
   637  	0xc1, 0xe3, 0xb9, 0x7f, 0x20, 0x99, 0xd6, 0x16, 0xb9, 0x84, 0xc3, 0x04, 0x05, 0x8b, 0x98, 0x60,
   638  	0xfe, 0xa1, 0x14, 0xcd, 0xa3, 0x1a, 0xd3, 0xe3, 0x8f, 0x3a, 0x7a, 0x9d, 0x0a, 0xbe, 0xa6, 0x9b,
   639  	0xe4, 0xc1, 0x15, 0x74, 0x6b, 0x21, 0xd2, 0x87, 0xf6, 0x02, 0xd7, 0x7a, 0xe2, 0xea, 0x4a, 0x4e,
   640  	0xc1, 0x59, 0xb1, 0x65, 0x89, 0x7a, 0x56, 0x65, 0xbc, 0xb1, 0x5f, 0x59, 0xcf, 0x42, 0xf0, 0x36,
   641  	0x6a, 0x20, 0x00, 0xae, 0x92, 0x5f, 0xbf, 0x55, 0xdd, 0x95, 0xf0, 0xfa, 0x56, 0x75, 0x57, 0x92,
   642  	0xeb, 0xdb, 0x93, 0x12, 0x5c, 0xaa, 0x86, 0x7b, 0x0d, 0xae, 0xfa, 0xe2, 0xa4, 0xb1, 0x1f, 0x5a,
   643  	0xcd, 0x83, 0xb3, 0xa6, 0x5b, 0xeb, 0xb5, 0x45, 0x2e, 0xc0, 0x91, 0xba, 0x27, 0xa7, 0x26, 0x65,
   644  	0x77, 0x0d, 0x06, 0xdd, 0x9a, 0x50, 0x83, 0xd6, 0x85, 0x35, 0xf9, 0x69, 0x81, 0x73, 0xc3, 0x66,
   645  	0x4b, 0x24, 0x2f, 0x0c, 0x48, 0x52, 0x57, 0xe2, 0xf6, 0xef, 0x1a, 0x2b, 0xd4, 0xaa, 0x4a, 0xd4,
   646  	0x2c, 0x7b, 0x4b, 0x1a, 0x3b, 0x26, 0x4b, 0xd4, 0xc8, 0x7b, 0x4b, 0x1a, 0x4b, 0xd8, 0x22, 0x53,
   647  	0xe8, 0x54, 0x0f, 0x13, 0x39, 0xd9, 0x14, 0x6c, 0xdf, 0xb3, 0xc1, 0x69, 0xdd, 0x69, 0x8a, 0xde,
   648  	0x86, 0xb7, 0xcf, 0xef, 0x62, 0x71, 0x5f, 0xce, 0xc6, 0xf3, 0x2c, 0x09, 0x93, 0x78, 0xce, 0x33,
   649  	0xfd, 0xbb, 0x9a, 0x86, 0xf2, 0x85, 0xd4, 0xcf, 0xe5, 0x95, 0x3a, 0x66, 0xae, 0x74, 0x4e, 0x7f,
   650  	0x05, 0x00, 0x00, 0xff, 0xff, 0x54, 0xb5, 0x59, 0x40, 0x4d, 0x05, 0x00, 0x00,
   651  }
   652  
   653  // Reference imports to suppress errors if they are not otherwise used.
   654  var _ context.Context
   655  var _ grpc.ClientConn
   656  
   657  // This is a compile-time assertion to ensure that this generated file
   658  // is compatible with the grpc package it is being compiled against.
   659  const _ = grpc.SupportPackageIsVersion4
   660  
   661  // RouterClient is the client API for Router service.
   662  //
   663  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   664  type RouterClient interface {
   665  	Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error)
   666  	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Router_WatchClient, error)
   667  }
   668  
   669  type routerClient struct {
   670  	cc *grpc.ClientConn
   671  }
   672  
   673  func NewRouterClient(cc *grpc.ClientConn) RouterClient {
   674  	return &routerClient{cc}
   675  }
   676  
   677  func (c *routerClient) Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) {
   678  	out := new(LookupResponse)
   679  	err := c.cc.Invoke(ctx, "/router.Router/Lookup", in, out, opts...)
   680  	if err != nil {
   681  		return nil, err
   682  	}
   683  	return out, nil
   684  }
   685  
   686  func (c *routerClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Router_WatchClient, error) {
   687  	stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[0], "/router.Router/Watch", opts...)
   688  	if err != nil {
   689  		return nil, err
   690  	}
   691  	x := &routerWatchClient{stream}
   692  	if err := x.ClientStream.SendMsg(in); err != nil {
   693  		return nil, err
   694  	}
   695  	if err := x.ClientStream.CloseSend(); err != nil {
   696  		return nil, err
   697  	}
   698  	return x, nil
   699  }
   700  
   701  type Router_WatchClient interface {
   702  	Recv() (*Event, error)
   703  	grpc.ClientStream
   704  }
   705  
   706  type routerWatchClient struct {
   707  	grpc.ClientStream
   708  }
   709  
   710  func (x *routerWatchClient) Recv() (*Event, error) {
   711  	m := new(Event)
   712  	if err := x.ClientStream.RecvMsg(m); err != nil {
   713  		return nil, err
   714  	}
   715  	return m, nil
   716  }
   717  
   718  // RouterServer is the server API for Router service.
   719  type RouterServer interface {
   720  	Lookup(context.Context, *LookupRequest) (*LookupResponse, error)
   721  	Watch(*WatchRequest, Router_WatchServer) error
   722  }
   723  
   724  func RegisterRouterServer(s *grpc.Server, srv RouterServer) {
   725  	s.RegisterService(&_Router_serviceDesc, srv)
   726  }
   727  
   728  func _Router_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   729  	in := new(LookupRequest)
   730  	if err := dec(in); err != nil {
   731  		return nil, err
   732  	}
   733  	if interceptor == nil {
   734  		return srv.(RouterServer).Lookup(ctx, in)
   735  	}
   736  	info := &grpc.UnaryServerInfo{
   737  		Server:     srv,
   738  		FullMethod: "/router.Router/Lookup",
   739  	}
   740  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   741  		return srv.(RouterServer).Lookup(ctx, req.(*LookupRequest))
   742  	}
   743  	return interceptor(ctx, in, info, handler)
   744  }
   745  
   746  func _Router_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
   747  	m := new(WatchRequest)
   748  	if err := stream.RecvMsg(m); err != nil {
   749  		return err
   750  	}
   751  	return srv.(RouterServer).Watch(m, &routerWatchServer{stream})
   752  }
   753  
   754  type Router_WatchServer interface {
   755  	Send(*Event) error
   756  	grpc.ServerStream
   757  }
   758  
   759  type routerWatchServer struct {
   760  	grpc.ServerStream
   761  }
   762  
   763  func (x *routerWatchServer) Send(m *Event) error {
   764  	return x.ServerStream.SendMsg(m)
   765  }
   766  
   767  var _Router_serviceDesc = grpc.ServiceDesc{
   768  	ServiceName: "router.Router",
   769  	HandlerType: (*RouterServer)(nil),
   770  	Methods: []grpc.MethodDesc{
   771  		{
   772  			MethodName: "Lookup",
   773  			Handler:    _Router_Lookup_Handler,
   774  		},
   775  	},
   776  	Streams: []grpc.StreamDesc{
   777  		{
   778  			StreamName:    "Watch",
   779  			Handler:       _Router_Watch_Handler,
   780  			ServerStreams: true,
   781  		},
   782  	},
   783  	Metadata: "router/router.proto",
   784  }
   785  
   786  // TableClient is the client API for Table service.
   787  //
   788  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   789  type TableClient interface {
   790  	Create(ctx context.Context, in *Route, opts ...grpc.CallOption) (*CreateResponse, error)
   791  	Delete(ctx context.Context, in *Route, opts ...grpc.CallOption) (*DeleteResponse, error)
   792  	Update(ctx context.Context, in *Route, opts ...grpc.CallOption) (*UpdateResponse, error)
   793  	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
   794  }
   795  
   796  type tableClient struct {
   797  	cc *grpc.ClientConn
   798  }
   799  
   800  func NewTableClient(cc *grpc.ClientConn) TableClient {
   801  	return &tableClient{cc}
   802  }
   803  
   804  func (c *tableClient) Create(ctx context.Context, in *Route, opts ...grpc.CallOption) (*CreateResponse, error) {
   805  	out := new(CreateResponse)
   806  	err := c.cc.Invoke(ctx, "/router.Table/Create", in, out, opts...)
   807  	if err != nil {
   808  		return nil, err
   809  	}
   810  	return out, nil
   811  }
   812  
   813  func (c *tableClient) Delete(ctx context.Context, in *Route, opts ...grpc.CallOption) (*DeleteResponse, error) {
   814  	out := new(DeleteResponse)
   815  	err := c.cc.Invoke(ctx, "/router.Table/Delete", in, out, opts...)
   816  	if err != nil {
   817  		return nil, err
   818  	}
   819  	return out, nil
   820  }
   821  
   822  func (c *tableClient) Update(ctx context.Context, in *Route, opts ...grpc.CallOption) (*UpdateResponse, error) {
   823  	out := new(UpdateResponse)
   824  	err := c.cc.Invoke(ctx, "/router.Table/Update", in, out, opts...)
   825  	if err != nil {
   826  		return nil, err
   827  	}
   828  	return out, nil
   829  }
   830  
   831  func (c *tableClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
   832  	out := new(ReadResponse)
   833  	err := c.cc.Invoke(ctx, "/router.Table/Read", in, out, opts...)
   834  	if err != nil {
   835  		return nil, err
   836  	}
   837  	return out, nil
   838  }
   839  
   840  // TableServer is the server API for Table service.
   841  type TableServer interface {
   842  	Create(context.Context, *Route) (*CreateResponse, error)
   843  	Delete(context.Context, *Route) (*DeleteResponse, error)
   844  	Update(context.Context, *Route) (*UpdateResponse, error)
   845  	Read(context.Context, *ReadRequest) (*ReadResponse, error)
   846  }
   847  
   848  func RegisterTableServer(s *grpc.Server, srv TableServer) {
   849  	s.RegisterService(&_Table_serviceDesc, srv)
   850  }
   851  
   852  func _Table_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   853  	in := new(Route)
   854  	if err := dec(in); err != nil {
   855  		return nil, err
   856  	}
   857  	if interceptor == nil {
   858  		return srv.(TableServer).Create(ctx, in)
   859  	}
   860  	info := &grpc.UnaryServerInfo{
   861  		Server:     srv,
   862  		FullMethod: "/router.Table/Create",
   863  	}
   864  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   865  		return srv.(TableServer).Create(ctx, req.(*Route))
   866  	}
   867  	return interceptor(ctx, in, info, handler)
   868  }
   869  
   870  func _Table_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   871  	in := new(Route)
   872  	if err := dec(in); err != nil {
   873  		return nil, err
   874  	}
   875  	if interceptor == nil {
   876  		return srv.(TableServer).Delete(ctx, in)
   877  	}
   878  	info := &grpc.UnaryServerInfo{
   879  		Server:     srv,
   880  		FullMethod: "/router.Table/Delete",
   881  	}
   882  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   883  		return srv.(TableServer).Delete(ctx, req.(*Route))
   884  	}
   885  	return interceptor(ctx, in, info, handler)
   886  }
   887  
   888  func _Table_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   889  	in := new(Route)
   890  	if err := dec(in); err != nil {
   891  		return nil, err
   892  	}
   893  	if interceptor == nil {
   894  		return srv.(TableServer).Update(ctx, in)
   895  	}
   896  	info := &grpc.UnaryServerInfo{
   897  		Server:     srv,
   898  		FullMethod: "/router.Table/Update",
   899  	}
   900  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   901  		return srv.(TableServer).Update(ctx, req.(*Route))
   902  	}
   903  	return interceptor(ctx, in, info, handler)
   904  }
   905  
   906  func _Table_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   907  	in := new(ReadRequest)
   908  	if err := dec(in); err != nil {
   909  		return nil, err
   910  	}
   911  	if interceptor == nil {
   912  		return srv.(TableServer).Read(ctx, in)
   913  	}
   914  	info := &grpc.UnaryServerInfo{
   915  		Server:     srv,
   916  		FullMethod: "/router.Table/Read",
   917  	}
   918  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   919  		return srv.(TableServer).Read(ctx, req.(*ReadRequest))
   920  	}
   921  	return interceptor(ctx, in, info, handler)
   922  }
   923  
   924  var _Table_serviceDesc = grpc.ServiceDesc{
   925  	ServiceName: "router.Table",
   926  	HandlerType: (*TableServer)(nil),
   927  	Methods: []grpc.MethodDesc{
   928  		{
   929  			MethodName: "Create",
   930  			Handler:    _Table_Create_Handler,
   931  		},
   932  		{
   933  			MethodName: "Delete",
   934  			Handler:    _Table_Delete_Handler,
   935  		},
   936  		{
   937  			MethodName: "Update",
   938  			Handler:    _Table_Update_Handler,
   939  		},
   940  		{
   941  			MethodName: "Read",
   942  			Handler:    _Table_Read_Handler,
   943  		},
   944  	},
   945  	Streams:  []grpc.StreamDesc{},
   946  	Metadata: "router/router.proto",
   947  }