Documentation ¶
Overview ¶
Package pointerverification implements verification of pointers.
Index ¶
- Variables
- func VerifyPieceAndLimit(ctx context.Context, piece *pb.SegmentPieceUploadResult, limit *pb.OrderLimit) (err error)
- type IdentityCache
- func (cache *IdentityCache) EnsureCached(ctx context.Context, nodes []storj.NodeID) (err error)
- func (cache *IdentityCache) GetCached(ctx context.Context, id storj.NodeID) *identity.PeerIdentity
- func (cache *IdentityCache) GetUpdated(ctx context.Context, id storj.NodeID) (_ *identity.PeerIdentity, err error)
- type InvalidPiece
- type Service
- func (service *Service) SelectValidPieces(ctx context.Context, uploadResponses []*pb.SegmentPieceUploadResult, ...) (valid []*pb.SegmentPieceUploadResult, invalid []InvalidPiece, err error)
- func (service *Service) VerifySizes(ctx context.Context, redundancy storj.RedundancyScheme, encryptedSize int64, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Error general pointer verification error. Error = errs.Class("pointer verification") )
Functions ¶
func VerifyPieceAndLimit ¶
func VerifyPieceAndLimit(ctx context.Context, piece *pb.SegmentPieceUploadResult, limit *pb.OrderLimit) (err error)
VerifyPieceAndLimit verifies that the piece and limit match.
Types ¶
type IdentityCache ¶
type IdentityCache struct {
// contains filtered or unexported fields
}
IdentityCache implements caching of *identity.PeerIdentity.
func NewIdentityCache ¶
func NewIdentityCache(db overlay.PeerIdentities) *IdentityCache
NewIdentityCache returns an IdentityCache.
func (*IdentityCache) EnsureCached ¶
EnsureCached loads any missing identity into cache.
func (*IdentityCache) GetCached ¶
func (cache *IdentityCache) GetCached(ctx context.Context, id storj.NodeID) *identity.PeerIdentity
GetCached returns the peer identity in the cache.
func (*IdentityCache) GetUpdated ¶
func (cache *IdentityCache) GetUpdated(ctx context.Context, id storj.NodeID) (_ *identity.PeerIdentity, err error)
GetUpdated returns the identity from database and updates the cache.
type InvalidPiece ¶
InvalidPiece is information about an invalid piece in the pointer.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a service for verifying validity of pieces.
func NewService ¶
func NewService(db overlay.PeerIdentities) *Service
NewService returns a service using the provided database.
func (*Service) SelectValidPieces ¶
func (service *Service) SelectValidPieces(ctx context.Context, uploadResponses []*pb.SegmentPieceUploadResult, originalLimits []*pb.OrderLimit) (valid []*pb.SegmentPieceUploadResult, invalid []InvalidPiece, err error)
SelectValidPieces selects pieces that are have correct hashes and match the original limits.
func (*Service) VerifySizes ¶
func (service *Service) VerifySizes(ctx context.Context, redundancy storj.RedundancyScheme, encryptedSize int64, uploadResponses []*pb.SegmentPieceUploadResult) (err error)
VerifySizes verifies that the remote piece sizes in commitSegment match each other.