github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/protos/node/grpc/node.proto (about)

     1  syntax = "proto3";
     2  
     3  package yuhaiin.protos.node.service;
     4  
     5  option go_package = "github.com/Asutorufa/yuhaiin/pkg/protos/node/service";
     6  
     7  import "google/protobuf/empty.proto";
     8  import "google/protobuf/wrappers.proto";
     9  import "node/node.proto";
    10  import "node/point/point.proto";
    11  import "node/subscribe/subscribe.proto";
    12  import "node/latency/latency.proto";
    13  import "node/tag/tag.proto";
    14  
    15  service node {
    16    rpc now(google.protobuf.Empty) returns (now_resp);
    17    // use req is hash string of point
    18    rpc use(use_req) returns (yuhaiin.point.point);
    19  
    20    rpc get(google.protobuf.StringValue) returns (yuhaiin.point.point);
    21    rpc save(yuhaiin.point.point) returns (yuhaiin.point.point);
    22    rpc remove(google.protobuf.StringValue) returns (google.protobuf.Empty);
    23    rpc manager(google.protobuf.Empty) returns (yuhaiin.node.manager);
    24  
    25    rpc latency(yuhaiin.latency.requests) returns (yuhaiin.latency.response);
    26  }
    27  
    28  message now_resp {
    29    yuhaiin.point.point tcp = 1 [ json_name = "tcp" ];
    30    yuhaiin.point.point udp = 2 [ json_name = "udp" ];
    31  }
    32  
    33  message use_req {
    34    bool tcp = 1 [ json_name = "tcp" ];
    35    bool udp = 2 [ json_name = "udp" ];
    36    string hash = 3 [ json_name = "hash" ];
    37  }
    38  
    39  service subscribe {
    40    rpc save(save_link_req) returns (google.protobuf.Empty);
    41    rpc remove(link_req) returns (google.protobuf.Empty);
    42    rpc update(link_req) returns (google.protobuf.Empty);
    43    rpc get(google.protobuf.Empty) returns (get_links_resp);
    44  }
    45  
    46  message save_link_req {
    47    repeated yuhaiin.subscribe.link links = 1 [ json_name = "links" ];
    48  }
    49  message link_req { repeated string names = 1 [ json_name = "names" ]; }
    50  message get_links_resp {
    51    map<string, yuhaiin.subscribe.link> links = 1 [ json_name = "links" ];
    52  }
    53  
    54  service tag {
    55    rpc save(save_tag_req) returns (google.protobuf.Empty);
    56    rpc remove(google.protobuf.StringValue) returns (google.protobuf.Empty);
    57  }
    58  
    59  message save_tag_req {
    60    string tag = 1 [ json_name = "tag" ];
    61    yuhaiin.tag.tag_type type = 3 [ json_name = "type" ];
    62    string hash = 2 [ json_name = "hash" ];
    63  }