f9845e7e92
* added rollup to captplanet, moved accountingDB to masterdb
21 lines
612 B
Go
21 lines
612 B
Go
// Copyright (C) 2018 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package accounting
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
//DB is an interface for interacting with accounting stuff
|
|
type DB interface {
|
|
// LastGranularTime records the greatest last tallied bandwidth agreement time
|
|
LastGranularTime(ctx context.Context) (time.Time, bool, error)
|
|
// SaveGranulars records granular tallies (sums of bw agreement values) to the database
|
|
// and updates the LastGranularTime
|
|
SaveGranulars(ctx context.Context, logger *zap.Logger, latestBwa time.Time, bwTotals map[string]int64) error
|
|
}
|