Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/storage/chunk/client/client.go

30 lines
998 B

package client
import (
"context"
"errors"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/stores/series/index"
)
var (
// ErrMethodNotImplemented when any of the storage clients do not implement a method
ErrMethodNotImplemented = errors.New("method is not implemented")
// ErrStorageObjectNotFound when object storage does not have requested object
ErrStorageObjectNotFound = errors.New("object not found in storage")
)
// Client is for storing and retrieving chunks.
type Client interface {
Stop()
PutChunks(ctx context.Context, chunks []chunk.Chunk) error
GetChunks(ctx context.Context, chunks []chunk.Chunk) ([]chunk.Chunk, error)
DeleteChunk(ctx context.Context, userID, chunkID string) error
IsChunkNotFoundErr(err error) bool
}
// ObjectAndIndexClient allows optimisations where the same client handles both
type ObjectAndIndexClient interface {
PutChunksAndIndex(ctx context.Context, chunks []chunk.Chunk, index index.WriteBatch) error
}