2019-01-24 16:26:36 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-11-08 14:19:42 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2019-01-15 13:03:24 +00:00
|
|
|
package console
|
2018-11-08 14:19:42 +00:00
|
|
|
|
2019-03-06 15:54:48 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"storj.io/storj/pkg/accounting"
|
|
|
|
)
|
2018-12-10 12:29:01 +00:00
|
|
|
|
2018-11-08 14:19:42 +00:00
|
|
|
// DB contains access to different satellite databases
|
|
|
|
type DB interface {
|
2018-11-20 14:50:47 +00:00
|
|
|
// Users is a getter for Users repository
|
2018-11-08 14:19:42 +00:00
|
|
|
Users() Users
|
2018-11-20 14:50:47 +00:00
|
|
|
// Projects is a getter for Projects repository
|
2018-11-13 08:27:42 +00:00
|
|
|
Projects() Projects
|
2018-11-20 14:50:47 +00:00
|
|
|
// ProjectMembers is a getter for ProjectMembers repository
|
|
|
|
ProjectMembers() ProjectMembers
|
2018-12-26 14:00:53 +00:00
|
|
|
// APIKeys is a getter for APIKeys repository
|
|
|
|
APIKeys() APIKeys
|
2019-03-06 15:54:48 +00:00
|
|
|
// BucketUsage is a getter for accounting.BucketUsage repository
|
|
|
|
BucketUsage() accounting.BucketUsage
|
2019-03-19 17:55:43 +00:00
|
|
|
// RegistrationTokens is a getter for RegistrationTokens repository
|
|
|
|
RegistrationTokens() RegistrationTokens
|
2019-04-04 15:56:20 +01:00
|
|
|
// UsageRollups is a getter for UsageRollups repository
|
|
|
|
UsageRollups() UsageRollups
|
2018-11-08 14:19:42 +00:00
|
|
|
|
2018-12-10 12:29:01 +00:00
|
|
|
// BeginTransaction is a method for opening transaction
|
|
|
|
BeginTx(ctx context.Context) (DBTx, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
// DBTx extends Database with transaction scope
|
|
|
|
type DBTx interface {
|
|
|
|
DB
|
|
|
|
// CommitTransaction is a method for committing and closing transaction
|
|
|
|
Commit() error
|
|
|
|
// RollbackTransaction is a method for rollback and closing transaction
|
|
|
|
Rollback() error
|
2018-11-08 14:19:42 +00:00
|
|
|
}
|