Versions in this module Expand all Collapse all v3 v3.0.0 Apr 8, 2024 Changes in this version + var ErrIntOverflowTestTypes = fmt.Errorf("proto: integer overflow") + var ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthTestTypes = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + type CacheGenNumberLoader interface + GetResultsCacheGenNumber func(tenantIDs []string) string + Stop func() + type CachedResponse struct + Extents []Extent + Key string + func (*CachedResponse) Descriptor() ([]byte, []int) + func (*CachedResponse) ProtoMessage() + func (m *CachedResponse) GetExtents() []Extent + func (m *CachedResponse) GetKey() string + func (m *CachedResponse) Marshal() (dAtA []byte, err error) + func (m *CachedResponse) MarshalTo(dAtA []byte) (int, error) + func (m *CachedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *CachedResponse) Reset() + func (m *CachedResponse) Size() (n int) + func (m *CachedResponse) Unmarshal(dAtA []byte) error + func (m *CachedResponse) XXX_DiscardUnknown() + func (m *CachedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *CachedResponse) XXX_Merge(src proto.Message) + func (m *CachedResponse) XXX_Size() int + func (m *CachedResponse) XXX_Unmarshal(b []byte) error + func (this *CachedResponse) Equal(that interface{}) bool + func (this *CachedResponse) GoString() string + func (this *CachedResponse) String() string + type CachingOptions struct + Disabled bool + func (*CachingOptions) Descriptor() ([]byte, []int) + func (*CachingOptions) ProtoMessage() + func (m *CachingOptions) GetDisabled() bool + func (m *CachingOptions) Marshal() (dAtA []byte, err error) + func (m *CachingOptions) MarshalTo(dAtA []byte) (int, error) + func (m *CachingOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *CachingOptions) Reset() + func (m *CachingOptions) Size() (n int) + func (m *CachingOptions) Unmarshal(dAtA []byte) error + func (m *CachingOptions) XXX_DiscardUnknown() + func (m *CachingOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *CachingOptions) XXX_Merge(src proto.Message) + func (m *CachingOptions) XXX_Size() int + func (m *CachingOptions) XXX_Unmarshal(b []byte) error + func (this *CachingOptions) Equal(that interface{}) bool + func (this *CachingOptions) GoString() string + func (this *CachingOptions) String() string + type Config struct + CacheConfig cache.Config + Compression string + func (cfg *Config) RegisterFlags(f *flag.FlagSet) + func (cfg *Config) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string) + func (cfg *Config) Validate() error + type ConstSplitter time.Duration + func (t ConstSplitter) GenerateCacheKey(_ context.Context, userID string, r Request) string + type Extent struct + End int64 + Response *types.Any + Start int64 + TraceId string + func (*Extent) Descriptor() ([]byte, []int) + func (*Extent) ProtoMessage() + func (m *Extent) GetEnd() int64 + func (m *Extent) GetResponse() *types.Any + func (m *Extent) GetStart() int64 + func (m *Extent) GetTraceId() string + func (m *Extent) Marshal() (dAtA []byte, err error) + func (m *Extent) MarshalTo(dAtA []byte) (int, error) + func (m *Extent) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Extent) Reset() + func (m *Extent) Size() (n int) + func (m *Extent) Unmarshal(dAtA []byte) error + func (m *Extent) XXX_DiscardUnknown() + func (m *Extent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Extent) XXX_Merge(src proto.Message) + func (m *Extent) XXX_Size() int + func (m *Extent) XXX_Unmarshal(b []byte) error + func (this *Extent) Equal(that interface{}) bool + func (this *Extent) GoString() string + func (this *Extent) String() string + type Extractor interface + Extract func(start, end int64, res Response, resStart, resEnd int64) Response + type Handler interface + Do func(ctx context.Context, req Request) (Response, error) + type HandlerFunc func(context.Context, Request) (Response, error) + func (q HandlerFunc) Do(ctx context.Context, req Request) (Response, error) + type KeyGenerator interface + GenerateCacheKey func(ctx context.Context, userID string, r Request) string + type Limits interface + MaxCacheFreshness func(ctx context.Context, tenantID string) time.Duration + type MockLabelsPair struct + Name string + Value string + func (*MockLabelsPair) Descriptor() ([]byte, []int) + func (*MockLabelsPair) ProtoMessage() + func (m *MockLabelsPair) GetName() string + func (m *MockLabelsPair) GetValue() string + func (m *MockLabelsPair) Marshal() (dAtA []byte, err error) + func (m *MockLabelsPair) MarshalTo(dAtA []byte) (int, error) + func (m *MockLabelsPair) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *MockLabelsPair) Reset() + func (m *MockLabelsPair) Size() (n int) + func (m *MockLabelsPair) Unmarshal(dAtA []byte) error + func (m *MockLabelsPair) XXX_DiscardUnknown() + func (m *MockLabelsPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *MockLabelsPair) XXX_Merge(src proto.Message) + func (m *MockLabelsPair) XXX_Size() int + func (m *MockLabelsPair) XXX_Unmarshal(b []byte) error + func (this *MockLabelsPair) Equal(that interface{}) bool + func (this *MockLabelsPair) GoString() string + func (this *MockLabelsPair) String() string + type MockRequest struct + CachingOptions CachingOptions + End time.Time + Path string + Query string + Start time.Time + Step int64 + func (*MockRequest) Descriptor() ([]byte, []int) + func (*MockRequest) ProtoMessage() + func (m *MockRequest) GetCachingOptions() CachingOptions + func (m *MockRequest) GetEnd() time.Time + func (m *MockRequest) GetPath() string + func (m *MockRequest) GetQuery() string + func (m *MockRequest) GetStart() time.Time + func (m *MockRequest) GetStep() int64 + func (m *MockRequest) Marshal() (dAtA []byte, err error) + func (m *MockRequest) MarshalTo(dAtA []byte) (int, error) + func (m *MockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *MockRequest) Reset() + func (m *MockRequest) Size() (n int) + func (m *MockRequest) Unmarshal(dAtA []byte) error + func (m *MockRequest) XXX_DiscardUnknown() + func (m *MockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *MockRequest) XXX_Merge(src proto.Message) + func (m *MockRequest) XXX_Size() int + func (m *MockRequest) XXX_Unmarshal(b []byte) error + func (this *MockRequest) Equal(that interface{}) bool + func (this *MockRequest) GoString() string + func (this *MockRequest) String() string + type MockResponse struct + Labels []*MockLabelsPair + Samples []*MockSample + func (*MockResponse) Descriptor() ([]byte, []int) + func (*MockResponse) ProtoMessage() + func (m *MockResponse) GetLabels() []*MockLabelsPair + func (m *MockResponse) GetSamples() []*MockSample + func (m *MockResponse) Marshal() (dAtA []byte, err error) + func (m *MockResponse) MarshalTo(dAtA []byte) (int, error) + func (m *MockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *MockResponse) Reset() + func (m *MockResponse) Size() (n int) + func (m *MockResponse) Unmarshal(dAtA []byte) error + func (m *MockResponse) XXX_DiscardUnknown() + func (m *MockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *MockResponse) XXX_Merge(src proto.Message) + func (m *MockResponse) XXX_Size() int + func (m *MockResponse) XXX_Unmarshal(b []byte) error + func (this *MockResponse) Equal(that interface{}) bool + func (this *MockResponse) GoString() string + func (this *MockResponse) String() string + type MockSample struct + TimestampMs int64 + Value float64 + func (*MockSample) Descriptor() ([]byte, []int) + func (*MockSample) ProtoMessage() + func (m *MockSample) GetTimestampMs() int64 + func (m *MockSample) GetValue() float64 + func (m *MockSample) Marshal() (dAtA []byte, err error) + func (m *MockSample) MarshalTo(dAtA []byte) (int, error) + func (m *MockSample) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *MockSample) Reset() + func (m *MockSample) Size() (n int) + func (m *MockSample) Unmarshal(dAtA []byte) error + func (m *MockSample) XXX_DiscardUnknown() + func (m *MockSample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *MockSample) XXX_Merge(src proto.Message) + func (m *MockSample) XXX_Size() int + func (m *MockSample) XXX_Unmarshal(b []byte) error + func (this *MockSample) Equal(that interface{}) bool + func (this *MockSample) GoString() string + func (this *MockSample) String() string + type ParallelismForReqFn func(ctx context.Context, tenantIDs []string, r Request) int + type Request interface + GetCachingOptions func() CachingOptions + GetEnd func() time.Time + GetQuery func() string + GetStart func() time.Time + GetStep func() int64 + WithStartEndForCache func(start time.Time, end time.Time) Request + type RequestResponse struct + Request Request + Response Response + func DoRequests(ctx context.Context, downstream Handler, reqs []Request, parallelism int) ([]RequestResponse, error) + type Response interface + type ResponseMerger interface + MergeResponse func(...Response) (Response, error) + type ResultsCache struct + func NewResultsCache(logger log.Logger, c cache.Cache, next Handler, keyGen KeyGenerator, ...) *ResultsCache + func (s ResultsCache) Do(ctx context.Context, r Request) (Response, error) + type ShouldCacheReqFn func(ctx context.Context, r Request) bool + type ShouldCacheResFn func(ctx context.Context, r Request, res Response, maxCacheTime int64) bool