github.com/sercand/please@v13.4.0+incompatible/src/cache/proto/rpc_server.proto (about)

     1  // Defines the inter-server RPC cache interface for running a cluster.
     2  // Services in here aren't needed to be used by a client.
     3  
     4  syntax = "proto3";
     5  
     6  option java_package = "net.thoughtmachine.please.cache";
     7  
     8  import "src/cache/proto/rpc_cache.proto";
     9  
    10  package proto.rpc_cache;
    11  
    12  service RpcServer {
    13      // Requests to join the cluster. Response indicates whether the client
    14      // is allowed to join.
    15      rpc Join(JoinRequest) returns (JoinResponse);
    16      // Adds an artifact to this node which has already been added to another.
    17      // Used to mirror stored artifacts between replicas.
    18      rpc Replicate(ReplicateRequest) returns (ReplicateResponse);
    19  }
    20  
    21  message JoinRequest {
    22      // Identifier of the machine.
    23      string name = 1;
    24      // Address & port of the machine.
    25      string address = 2;
    26  }
    27  
    28  message JoinResponse {
    29      // True if the caller is allowed to join the cluster.
    30      bool success = 1;
    31      // The node corresponding to the requestor. Will also appear in `nodes`.
    32      Node node = 2;
    33      // List of other known nodes.
    34      repeated Node nodes = 3;
    35      // Expected size of the cluster.
    36      int32 size = 6;
    37  }
    38  
    39  message ReplicateRequest {
    40      // Sequence of artifacts to store.
    41      repeated Artifact artifacts = 1;
    42      // OS of requestor
    43      string os = 2;
    44      // Architecture of requestor
    45      string arch = 3;
    46      // Hash of rule that generated these artifacts
    47      bytes hash = 4;
    48      // True to delete the artifact
    49      bool delete = 5;
    50      // Hostname of the original sender who stored this
    51      string hostname = 6;
    52      // Hostname of the peer sending this request
    53      string peer = 7;
    54  }
    55  
    56  message ReplicateResponse {
    57      // True if store was successful.
    58      bool success = 1;
    59  }