storj/satellite/repair/irreparable/irreparable.go
Egon Elbre 267506bb20 satellite/metabase: move package one level higher
metabase has become a central concept and it's more suitable for it to
be directly nested under satellite rather than being part of metainfo.

metainfo is going to be the "endpoint" logic for handling requests.

Change-Id: I53770d6761ac1e9a1283b5aa68f471b21e784198
2021-04-21 15:54:22 +03:00

26 lines
991 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package irreparable
import (
"context"
"storj.io/storj/satellite/internalpb"
"storj.io/storj/satellite/metabase"
)
// DB stores information about repairs that have failed.
//
// architecture: Database
type DB interface {
// IncrementRepairAttempts increments the repair attempts.
IncrementRepairAttempts(ctx context.Context, segmentInfo *internalpb.IrreparableSegment) error
// Get returns irreparable segment info based on segmentKey.
Get(ctx context.Context, segmentKey metabase.SegmentKey) (*internalpb.IrreparableSegment, error)
// GetLimited returns a list of irreparable segment info starting after the last segment info we retrieved
GetLimited(ctx context.Context, limit int, lastSeenSegmentKey metabase.SegmentKey) ([]*internalpb.IrreparableSegment, error)
// Delete removes irreparable segment info based on segmentKey.
Delete(ctx context.Context, segmentKey metabase.SegmentKey) error
}