Documentation ¶
Index ¶
- Constants
- Variables
- func ArchiveFileName(satelliteID storj.NodeID, creationTime, archiveTime time.Time, ...) string
- func MoveUnsent(unsentDir, archiveDir string, satelliteID storj.NodeID, ...) error
- func UnsentFileName(satelliteID storj.NodeID, creationTime time.Time, version Version) string
- type ArchivedInfo
- type Info
- type Readable
- type UnsentInfo
- type Version
- type Writable
Constants ¶
const ( // V0 is the first orders file version. It stores orders and limits with no checksum. V0 = Version("v0") // V1 is the second orders file version. It includes a checksum for each entry so that file corruption is handled better. V1 = Version("v1") )
Variables ¶
var ( // Error identifies errors with orders files. Error = errs.Class("ordersfile") // ErrEntryCorrupt is returned when a corrupt entry is found. ErrEntryCorrupt = errs.Class("ordersfile corrupt entry") )
Functions ¶
func ArchiveFileName ¶
func ArchiveFileName(satelliteID storj.NodeID, creationTime, archiveTime time.Time, status pb.SettlementWithWindowResponse_Status, version Version) string
ArchiveFileName gets the filename of an archived file.
Types ¶
type ArchivedInfo ¶
type ArchivedInfo struct { SatelliteID storj.NodeID CreatedAtHour time.Time ArchivedAt time.Time StatusText string Version Version }
ArchivedInfo contains information relevant to an archived orders file, as well as information necessary to open it for reading.
func GetArchivedInfo ¶
func GetArchivedInfo(info os.FileInfo) (*ArchivedInfo, error)
GetArchivedInfo returns a new ArchivedInfo which can be used to get information about and read from an archived orders file.
type Info ¶
type Info struct { Limit *pb.OrderLimit Order *pb.Order }
Info contains full information about an order.
type Readable ¶
Readable defines an interface for a read-only orders file.
func OpenReadable ¶
OpenReadable opens for reading the unsent or archived orders file at a given path. It assumes the path has already been validated with GetUnsentInfo or GetArchivedInfo.
func OpenReadableV0 ¶
OpenReadableV0 opens for reading the unsent or archived orders file at a given path.
func OpenReadableV1 ¶
OpenReadableV1 opens for reading the unsent or archived orders file at a given path.
type UnsentInfo ¶
UnsentInfo contains information relevant to an unsent orders file, as well as information necessary to open it for reading.
func GetUnsentInfo ¶
func GetUnsentInfo(info os.FileInfo) (*UnsentInfo, error)
GetUnsentInfo returns a new UnsentInfo which can be used to get information about and read from an unsent orders file.
type Writable ¶
Writable defines an interface for a write-only orders file.
func OpenWritableUnsent ¶
func OpenWritableUnsent(unsentDir string, satelliteID storj.NodeID, creationTime time.Time) (Writable, error)
OpenWritableUnsent creates or opens for appending the unsent orders file for a given satellite ID and creation hour.
func OpenWritableV0 ¶
OpenWritableV0 opens for writing the unsent or archived orders file at a given path.