syntax = "proto3";
package thanos;

option go_package = "storepb";

import "gogoproto/gogo.proto";

option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_getters_all) = false;

message Label {
  string name  = 1;
  string value = 2;
}

message Chunk {
  enum Encoding {
    XOR = 0;
  }
  Encoding type  = 1;
  bytes data     = 2;
}

message Series {
  repeated Label labels     = 1 [(gogoproto.nullable) = false];
  repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false];
}

message AggrChunk {
  int64 min_time = 1;
  int64 max_time = 2;

  Chunk raw     = 3;
  Chunk count   = 4;
  Chunk sum     = 5;
  Chunk min     = 6;
  Chunk max     = 7;
  Chunk counter = 8;
}

// Matcher specifies a rule, which can match or set of labels or not.
message LabelMatcher {
  enum Type {
    EQ  = 0; // =
    NEQ = 1; // !=
    RE  = 2; // =~
    NRE = 3; // !~
  }
  Type type    = 1;
  string name  = 2;
  string value = 3;
}
