github.com/thanos-io/thanos@v0.32.5/pkg/store/storepb/testutil/client.go (about) 1 // Copyright (c) The Thanos Authors. 2 // Licensed under the Apache License 2.0. 3 4 package storetestutil 5 6 import ( 7 "github.com/prometheus/prometheus/model/labels" 8 9 "github.com/thanos-io/thanos/pkg/info/infopb" 10 "github.com/thanos-io/thanos/pkg/store/storepb" 11 ) 12 13 type TestClient struct { 14 storepb.StoreClient 15 16 Name string 17 18 ExtLset []labels.Labels 19 MinTime, MaxTime int64 20 Shardable bool 21 WithoutReplicaLabelsEnabled bool 22 IsLocalStore bool 23 StoreTSDBInfos []infopb.TSDBInfo 24 } 25 26 func (c TestClient) LabelSets() []labels.Labels { return c.ExtLset } 27 func (c TestClient) TimeRange() (mint, maxt int64) { return c.MinTime, c.MaxTime } 28 func (c TestClient) TSDBInfos() []infopb.TSDBInfo { return c.StoreTSDBInfos } 29 func (c TestClient) SupportsSharding() bool { return c.Shardable } 30 func (c TestClient) SupportsWithoutReplicaLabels() bool { return c.WithoutReplicaLabelsEnabled } 31 func (c TestClient) String() string { return c.Name } 32 func (c TestClient) Addr() (string, bool) { return c.Name, c.IsLocalStore }