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

     1  syntax = "proto3";
     2  
     3  package yuhaiin.protos.statistic.service;
     4  
     5  option go_package = "github.com/Asutorufa/yuhaiin/pkg/protos/statistic/service";
     6  
     7  import "google/protobuf/empty.proto";
     8  import "statistic/config.proto";
     9  
    10  service connections {
    11    rpc conns(google.protobuf.Empty) returns (notify_new_connections);
    12    rpc close_conn(notify_remove_connections) returns (google.protobuf.Empty);
    13    rpc total(google.protobuf.Empty) returns (total_flow);
    14    rpc notify(google.protobuf.Empty) returns (stream notify_data);
    15  }
    16  
    17  message total_flow {
    18    uint64 download = 1 [ json_name = "download" ];
    19    uint64 upload = 2 [ json_name = "upload" ];
    20  }
    21  
    22  message notify_data {
    23    oneof data {
    24      total_flow total_flow = 3;
    25      notify_new_connections notify_new_connections = 1;
    26      notify_remove_connections notify_remove_connections = 2;
    27    }
    28  }
    29  
    30  message notify_new_connections {
    31    repeated yuhaiin.statistic.connection connections = 1
    32        [ json_name = "connections" ];
    33  }
    34  
    35  message notify_remove_connections {
    36    repeated uint64 ids = 1 [ json_name = "ids" ];
    37  }