syntax = "proto3";

package mesh.v1;

option go_package = "atlassian.com/bitbucket/mesh/rpc/v1";
option java_multiple_files = true;
option java_outer_classname = "PackCacheProtos";
option java_package = "com.atlassian.bitbucket.mesh.rpc.v1";

/* Request to clear the Pack cache. The repository and cache_key are optional (and the cache_key is only used
   when the repository is provided) */
message RpcClearPackCacheRequest {
  //Optional. If not provided, all caches for all repositories are cleared.
  optional string repository = 1;
  //Optional. If not provided and repository is provided, all caches for the repository are cleared.
  //If the cache key ends with "*" then all cache entries which match the provided prefix will be cleared
  string cache_key = 2;
}

message RpcClearPackCacheResponse {
}

message RpcGetPackCacheStatisticsRequest {
  //Optional. If not provided, the cumulative statistics for all regions are returned.
  optional string repository = 1;
}

message RpcGetPackCacheStatisticsResponse {
  //The number of cache hits since startup
  uint64 hits = 1;
  //The number of cache misses since startup
  uint64 misses = 2;
  //The cache size in bytes
  uint64 size = 3;
}
