Skip to content

Commit 18a66d8

Browse files
committed
use interface for ingester
Signed-off-by: Mauro Stettler <[email protected]>
1 parent ff90e89 commit 18a66d8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/api/api.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/cortexproject/cortex/pkg/chunk/purger"
3131
"github.com/cortexproject/cortex/pkg/compactor"
3232
"github.com/cortexproject/cortex/pkg/distributor"
33-
"github.com/cortexproject/cortex/pkg/ingester"
3433
"github.com/cortexproject/cortex/pkg/ingester/client"
3534
"github.com/cortexproject/cortex/pkg/querier"
3635
"github.com/cortexproject/cortex/pkg/querier/frontend"
@@ -201,8 +200,15 @@ func (a *API) RegisterDistributor(d *distributor.Distributor, pushConfig distrib
201200
a.RegisterRoute("/ha-tracker", d.HATracker, false, "GET")
202201
}
203202

203+
type ingester interface {
204+
client.IngesterServer
205+
FlushHandler(http.ResponseWriter, *http.Request)
206+
ShutdownHandler(http.ResponseWriter, *http.Request)
207+
Push(context.Context, *client.WriteRequest) (*client.WriteResponse, error)
208+
}
209+
204210
// RegisterIngester registers the ingesters HTTP and GRPC service
205-
func (a *API) RegisterIngester(i *ingester.Ingester, pushConfig distributor.Config) {
211+
func (a *API) RegisterIngester(i ingester, pushConfig distributor.Config) {
206212
client.RegisterIngesterServer(a.server.GRPC, i)
207213

208214
a.indexPage.AddLink(SectionDangerous, "/ingester/flush", "Trigger a Flush of data from Ingester to storage")

0 commit comments

Comments
 (0)