storj/satellite/repair/queue/queue.go
Alexander Leitner 159ad439b1
Add count to repair queue (#2661)
* Add count to repair queue
2019-07-30 11:21:40 -04:00

26 lines
832 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package queue
import (
"context"
"storj.io/storj/pkg/pb"
)
// RepairQueue implements queueing for segments that need repairing.
// Implementation can be found at satellite/satellitedb/repairqueue.go.
type RepairQueue interface {
// Insert adds an injured segment.
Insert(ctx context.Context, s *pb.InjuredSegment) error
// Select gets an injured segment.
Select(ctx context.Context) (*pb.InjuredSegment, error)
// Delete removes an injured segment.
Delete(ctx context.Context, s *pb.InjuredSegment) error
// SelectN lists limit amount of injured segments.
SelectN(ctx context.Context, limit int) ([]pb.InjuredSegment, error)
// Count counts the number of segments in the repair queue.
Count(ctx context.Context) (count int, err error)
}