storj/pkg/datarepair/irreparable/irreparable.go
Cameron c7ffbe1c28
Add ability to view irreparable segments on satellite (#1448)
* define irreparable inspector protobuf

* add IrreparableDB method GetLimited

* fill out irreparable inspector API

* add IrreparableInspector server to satellite, fix small error

* refactor IrreparableDB to use pb.IrreparableSegment instead of irreparable.RemoteSegmentInfo
2019-03-15 16:21:52 -04:00

23 lines
777 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package irreparable
import (
"context"
"storj.io/storj/pkg/pb"
)
// DB stores information about repairs that have failed.
type DB interface {
// IncrementRepairAttempts increments the repair attempts.
IncrementRepairAttempts(ctx context.Context, segmentInfo *pb.IrreparableSegment) error
// Get returns irreparable segment info based on segmentPath.
Get(ctx context.Context, segmentPath []byte) (*pb.IrreparableSegment, error)
// GetLimited number of segments from offset
GetLimited(ctx context.Context, limit int, offset int64) ([]*pb.IrreparableSegment, error)
// Delete removes irreparable segment info based on segmentPath.
Delete(ctx context.Context, segmentPath []byte) error
}