github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/ingester/client/cortex_mock_test.go (about) 1 package client 2 3 import ( 4 "context" 5 6 "github.com/stretchr/testify/mock" 7 8 "github.com/cortexproject/cortex/pkg/cortexpb" 9 ) 10 11 type IngesterServerMock struct { 12 mock.Mock 13 } 14 15 func (m *IngesterServerMock) Push(ctx context.Context, r *cortexpb.WriteRequest) (*cortexpb.WriteResponse, error) { 16 args := m.Called(ctx, r) 17 return args.Get(0).(*cortexpb.WriteResponse), args.Error(1) 18 } 19 20 func (m *IngesterServerMock) Query(ctx context.Context, r *QueryRequest) (*QueryResponse, error) { 21 args := m.Called(ctx, r) 22 return args.Get(0).(*QueryResponse), args.Error(1) 23 } 24 25 func (m *IngesterServerMock) QueryStream(r *QueryRequest, s Ingester_QueryStreamServer) error { 26 args := m.Called(r, s) 27 return args.Error(0) 28 } 29 30 func (m *IngesterServerMock) QueryExemplars(ctx context.Context, r *ExemplarQueryRequest) (*ExemplarQueryResponse, error) { 31 args := m.Called(ctx, r) 32 return args.Get(0).(*ExemplarQueryResponse), args.Error(1) 33 } 34 35 func (m *IngesterServerMock) LabelValues(ctx context.Context, r *LabelValuesRequest) (*LabelValuesResponse, error) { 36 args := m.Called(ctx, r) 37 return args.Get(0).(*LabelValuesResponse), args.Error(1) 38 } 39 40 func (m *IngesterServerMock) LabelNames(ctx context.Context, r *LabelNamesRequest) (*LabelNamesResponse, error) { 41 args := m.Called(ctx, r) 42 return args.Get(0).(*LabelNamesResponse), args.Error(1) 43 } 44 45 func (m *IngesterServerMock) UserStats(ctx context.Context, r *UserStatsRequest) (*UserStatsResponse, error) { 46 args := m.Called(ctx, r) 47 return args.Get(0).(*UserStatsResponse), args.Error(1) 48 } 49 50 func (m *IngesterServerMock) AllUserStats(ctx context.Context, r *UserStatsRequest) (*UsersStatsResponse, error) { 51 args := m.Called(ctx, r) 52 return args.Get(0).(*UsersStatsResponse), args.Error(1) 53 } 54 55 func (m *IngesterServerMock) MetricsForLabelMatchers(ctx context.Context, r *MetricsForLabelMatchersRequest) (*MetricsForLabelMatchersResponse, error) { 56 args := m.Called(ctx, r) 57 return args.Get(0).(*MetricsForLabelMatchersResponse), args.Error(1) 58 } 59 60 func (m *IngesterServerMock) MetricsMetadata(ctx context.Context, r *MetricsMetadataRequest) (*MetricsMetadataResponse, error) { 61 args := m.Called(ctx, r) 62 return args.Get(0).(*MetricsMetadataResponse), args.Error(1) 63 } 64 65 func (m *IngesterServerMock) TransferChunks(s Ingester_TransferChunksServer) error { 66 args := m.Called(s) 67 return args.Error(0) 68 }