2021-04-26 10:35:44 +01:00
|
|
|
// Copyright (C) 2021 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package metabasetest
|
|
|
|
|
2021-04-30 12:02:24 +01:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"storj.io/common/storj"
|
|
|
|
"storj.io/storj/satellite/metabase"
|
|
|
|
)
|
2021-04-26 10:35:44 +01:00
|
|
|
|
|
|
|
// DefaultRedundancy contains default redundancy scheme.
|
|
|
|
var DefaultRedundancy = storj.RedundancyScheme{
|
|
|
|
Algorithm: storj.ReedSolomon,
|
|
|
|
ShareSize: 2048,
|
|
|
|
RequiredShares: 1,
|
|
|
|
RepairShares: 1,
|
|
|
|
OptimalShares: 1,
|
|
|
|
TotalShares: 1,
|
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultEncryption contains default encryption parameters.
|
|
|
|
var DefaultEncryption = storj.EncryptionParameters{
|
|
|
|
CipherSuite: storj.EncAESGCM,
|
|
|
|
BlockSize: 29 * 256,
|
|
|
|
}
|
2021-04-30 12:02:24 +01:00
|
|
|
|
|
|
|
// DefaultRawSegment returns default raw segment.
|
|
|
|
func DefaultRawSegment(obj metabase.ObjectStream, segmentPosition metabase.SegmentPosition) metabase.RawSegment {
|
|
|
|
return metabase.RawSegment{
|
|
|
|
StreamID: obj.StreamID,
|
|
|
|
Position: segmentPosition,
|
|
|
|
RootPieceID: storj.PieceID{1},
|
|
|
|
Pieces: metabase.Pieces{{Number: 0, StorageNode: storj.NodeID{2}}},
|
2021-08-05 00:56:50 +01:00
|
|
|
CreatedAt: time.Now(),
|
2021-04-30 12:02:24 +01:00
|
|
|
|
|
|
|
EncryptedKey: []byte{3},
|
2021-10-12 14:37:12 +01:00
|
|
|
EncryptedKeyNonce: []byte{4},
|
2021-04-30 12:02:24 +01:00
|
|
|
EncryptedETag: []byte{5},
|
|
|
|
|
|
|
|
EncryptedSize: 1024,
|
|
|
|
PlainSize: 512,
|
|
|
|
PlainOffset: 0,
|
|
|
|
Redundancy: DefaultRedundancy,
|
|
|
|
}
|
|
|
|
}
|