Documentation ¶
Index ¶
- type Call
- type LabelValuesCall
- type MockQueryable
- func (m *MockQueryable) Close() error
- func (m *MockQueryable) LabelNames(_ ...*labels.Matcher) ([]string, storage.Warnings, error)
- func (m *MockQueryable) LabelValues(labelName string, matchers ...*labels.Matcher) ([]string, storage.Warnings, error)
- func (m *MockQueryable) Querier(_ context.Context, mint, maxt int64) (storage.Querier, error)
- func (m *MockQueryable) Select(sortSeries bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet
- func (m *MockQueryable) ValidateAllCalls()
- type SelectCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LabelValuesCall ¶
type MockQueryable ¶
type MockQueryable struct { TB testing.TB // List of expected calls to the Queryable's .Querier() method, // order is not enforced to allow for multi-threaded use. ExpectedQuerierCalls []Call // List of expected calls to the Querier's .Select() method, // order is not enforced to allow for multi-threaded use. ExpectedSelectCalls []SelectCall // List of expected calls to the Querier's .LabelValues() method, // order is not enforced to allow for multi-threaded use. ExpectedLabelValuesCalls []LabelValuesCall UnlimitedCalls bool // contains filtered or unexported fields }
MockQueryable can be used as a querier or queryable in test cases, it is only intended for unit tests and not for any production use. It takes a series of expected querier calls and select calls on the querier, it validates whether all the expected calls have been received and none more. For each expected call the return value can also be defined.
func (*MockQueryable) Close ¶
func (m *MockQueryable) Close() error
func (*MockQueryable) LabelNames ¶
func (*MockQueryable) LabelValues ¶
func (*MockQueryable) Select ¶
func (m *MockQueryable) Select(sortSeries bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet
func (*MockQueryable) ValidateAllCalls ¶
func (m *MockQueryable) ValidateAllCalls()
ValidateAllCalls checks if all the expected calls have been made, if not it raises a fatal error.
type SelectCall ¶
Click to show internal directories.
Click to hide internal directories.