Documentation ¶
Index ¶
- func InitDB() error
- type Account
- type Cockroach
- func (g *Cockroach) GetAccount(ops types.UserQueryOpts) (*types.Account, error)
- func (g *Cockroach) GetPayment(ops types.UserQueryOpts, startTime, endTime time.Time) ([]types.Payment, error)
- func (g *Cockroach) GetRechargeAmount(ops types.UserQueryOpts, startTime, endTime time.Time) (int64, error)
- func (g *Cockroach) GetTransfer(ops *types.UserQueryOpts) ([]types.Transfer, error)
- func (g *Cockroach) SetPaymentInvoice(req *helper.SetPaymentInvoiceReq) error
- func (g *Cockroach) Transfer(req *helper.TransferAmountReq) error
- type Interface
- type MongoDB
- func (m *MongoDB) GetBillingHistoryNamespaceList(req *helper.NamespaceBillingHistoryReq) ([]string, error)
- func (m *MongoDB) GetConsumptionAmount(user string, startTime, endTime time.Time) (int64, error)
- func (m *MongoDB) GetCosts(user string, startTime, endTime time.Time) (common.TimeCostsMap, error)
- func (m *MongoDB) GetProperties() ([]common.PropertyQuery, error)
- func (m *MongoDB) GetPropertiesUsedAmount(user string, startTime, endTime time.Time) (map[string]int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cockroach ¶
type Cockroach struct {
// contains filtered or unexported fields
}
func (*Cockroach) GetAccount ¶
func (*Cockroach) GetPayment ¶
func (*Cockroach) GetRechargeAmount ¶
func (*Cockroach) GetTransfer ¶
func (*Cockroach) SetPaymentInvoice ¶
func (g *Cockroach) SetPaymentInvoice(req *helper.SetPaymentInvoiceReq) error
type Interface ¶
type Interface interface { GetBillingHistoryNamespaceList(req *helper.NamespaceBillingHistoryReq) ([]string, error) GetProperties() ([]common.PropertyQuery, error) GetCosts(user string, startTime, endTime time.Time) (common.TimeCostsMap, error) GetConsumptionAmount(user string, startTime, endTime time.Time) (int64, error) GetRechargeAmount(ops types.UserQueryOpts, startTime, endTime time.Time) (int64, error) GetPropertiesUsedAmount(user string, startTime, endTime time.Time) (map[string]int64, error) GetAccount(ops types.UserQueryOpts) (*types.Account, error) GetPayment(ops types.UserQueryOpts, startTime, endTime time.Time) ([]types.Payment, error) SetPaymentInvoice(req *helper.SetPaymentInvoiceReq) error Transfer(req *helper.TransferAmountReq) error GetTransfer(ops *types.UserQueryOpts) ([]types.Transfer, error) }
var DBClient Interface
func NewAccountInterface ¶
type MongoDB ¶
type MongoDB struct { Client *mongo.Client AccountDBName string BillingConn string PropertiesConn string Properties *resources.PropertyTypeLS }
func (*MongoDB) GetBillingHistoryNamespaceList ¶
func (m *MongoDB) GetBillingHistoryNamespaceList(req *helper.NamespaceBillingHistoryReq) ([]string, error)
func (*MongoDB) GetConsumptionAmount ¶
func (*MongoDB) GetProperties ¶
func (m *MongoDB) GetProperties() ([]common.PropertyQuery, error)
Click to show internal directories.
Click to hide internal directories.