2018-11-26 21:49:55 +00:00
|
|
|
// Copyright (C) 2018 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package accounting
|
|
|
|
|
|
|
|
import (
|
2018-12-12 21:24:08 +00:00
|
|
|
"context"
|
2018-12-14 14:27:21 +00:00
|
|
|
"time"
|
2018-12-12 21:24:08 +00:00
|
|
|
|
2018-12-18 17:18:42 +00:00
|
|
|
"storj.io/storj/pkg/storj"
|
2018-12-07 14:46:42 +00:00
|
|
|
)
|
2018-12-05 14:03:23 +00:00
|
|
|
|
2018-12-14 14:27:21 +00:00
|
|
|
//DB is an interface for interacting with accounting stuff
|
|
|
|
type DB interface {
|
2018-12-18 17:18:42 +00:00
|
|
|
// LastRawTime records the greatest last tallied time
|
|
|
|
LastRawTime(ctx context.Context, timestampType string) (time.Time, bool, error)
|
|
|
|
// SaveBWRaw records raw sums of bw agreement values to the database
|
|
|
|
// and updates the LastRawTime
|
|
|
|
SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals map[string]int64) error
|
|
|
|
// SaveAtRestRaw records raw tallies of at rest data to the database
|
|
|
|
SaveAtRestRaw(ctx context.Context, latestTally time.Time, nodeData map[storj.NodeID]int64) error
|
2018-11-26 21:49:55 +00:00
|
|
|
}
|