storj/pkg/accounting/db.go
Bill Thorp f9845e7e92
changes to masterdb to support accountingDB (#846)
* added rollup to captplanet, moved accountingDB to masterdb
2018-12-14 09:27:21 -05:00

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
}