Documentation ¶
Index ¶
- func New(_ context.Context, d db.DB, m metrics.Collector) (db.DB, error)
- type CacheMem
- func (c *CacheMem) Close(ctx context.Context) db.Error
- func (c *CacheMem) CountFediAccounts(ctx context.Context) (int64, db.Error)
- func (c *CacheMem) CountFediAccountsForInstance(ctx context.Context, instanceID int64) (int64, db.Error)
- func (c *CacheMem) CountFediAccountsWithCouncil(ctx context.Context) (count int64, err db.Error)
- func (c *CacheMem) CountFediInstances(ctx context.Context) (int64, db.Error)
- func (c *CacheMem) CountTransactions(ctx context.Context) (count int64, err db.Error)
- func (c *CacheMem) CreateFediAccount(ctx context.Context, account *models.FediAccount) db.Error
- func (c *CacheMem) CreateFediInstance(ctx context.Context, instance *models.FediInstance) db.Error
- func (c *CacheMem) CreateTransaction(ctx context.Context, transaction *models.Transaction) (err db.Error)
- func (c *CacheMem) CreateTransactionTX(ctx context.Context, txID db.TxID, transaction *models.Transaction) (err db.Error)
- func (c *CacheMem) DoMigration(ctx context.Context) db.Error
- func (c *CacheMem) IncFediAccountLoginCount(ctx context.Context, account *models.FediAccount) db.Error
- func (c *CacheMem) LoadTestData(ctx context.Context) db.Error
- func (c *CacheMem) ReadFediAccount(ctx context.Context, id int64) (*models.FediAccount, db.Error)
- func (c *CacheMem) ReadFediAccountByUsername(ctx context.Context, instanceID int64, username string) (*models.FediAccount, db.Error)
- func (c *CacheMem) ReadFediAccountsPage(ctx context.Context, index, count int) (instances []*models.FediAccount, err db.Error)
- func (c *CacheMem) ReadFediInstance(ctx context.Context, id int64) (*models.FediInstance, db.Error)
- func (c *CacheMem) ReadFediInstanceByDomain(ctx context.Context, domain string) (*models.FediInstance, db.Error)
- func (c *CacheMem) ReadFediInstancesPage(ctx context.Context, index, count int) ([]*models.FediInstance, db.Error)
- func (c *CacheMem) ReadTransaction(ctx context.Context, id int64) (transaction *models.Transaction, err db.Error)
- func (c *CacheMem) ReadTransactionsPage(ctx context.Context, index, count int) (transactions []*models.Transaction, err db.Error)
- func (c *CacheMem) ResetCache(ctx context.Context) db.Error
- func (c *CacheMem) TxCommit(ctx context.Context, id db.TxID) db.Error
- func (c *CacheMem) TxNew(ctx context.Context) (db.TxID, db.Error)
- func (c *CacheMem) TxRollback(ctx context.Context, id db.TxID) db.Error
- func (c *CacheMem) UpdateFediAccount(ctx context.Context, account *models.FediAccount) db.Error
- func (c *CacheMem) UpdateFediInstance(ctx context.Context, instance *models.FediInstance) db.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheMem ¶
type CacheMem struct {
// contains filtered or unexported fields
}
CacheMem is an in memory caching middleware for our db interface.
func (*CacheMem) CountFediAccounts ¶
CountFediAccounts returns the number of federated social account.
func (*CacheMem) CountFediAccountsForInstance ¶
func (c *CacheMem) CountFediAccountsForInstance(ctx context.Context, instanceID int64) (int64, db.Error)
CountFediAccountsForInstance returns the number of federated social account for an instance.
func (*CacheMem) CountFediAccountsWithCouncil ¶
func (*CacheMem) CountFediInstances ¶
CountFediInstances returns the number of federated instances.
func (*CacheMem) CountTransactions ¶
func (*CacheMem) CreateFediAccount ¶
CreateFediAccount stores the federated instance and caches it.
func (*CacheMem) CreateFediInstance ¶
CreateFediInstance stores the federated instance and caches it.
func (*CacheMem) CreateTransaction ¶
func (*CacheMem) CreateTransactionTX ¶
func (*CacheMem) DoMigration ¶
DoMigration is a pass through.
func (*CacheMem) IncFediAccountLoginCount ¶
func (c *CacheMem) IncFediAccountLoginCount(ctx context.Context, account *models.FediAccount) db.Error
IncFediAccountLoginCount updates the login count of a stored federated instance.
func (*CacheMem) LoadTestData ¶
LoadTestData is a pass through.
func (*CacheMem) ReadFediAccount ¶
ReadFediAccount returns one federated social account.
func (*CacheMem) ReadFediAccountByUsername ¶
func (c *CacheMem) ReadFediAccountByUsername(ctx context.Context, instanceID int64, username string) (*models.FediAccount, db.Error)
ReadFediAccountByUsername returns one federated social account.
func (*CacheMem) ReadFediAccountsPage ¶
func (c *CacheMem) ReadFediAccountsPage(ctx context.Context, index, count int) (instances []*models.FediAccount, err db.Error)
ReadFediAccountsPage returns a page of federated social accounts.
func (*CacheMem) ReadFediInstance ¶
ReadFediInstance returns one federated social instance.
func (*CacheMem) ReadFediInstanceByDomain ¶
func (c *CacheMem) ReadFediInstanceByDomain(ctx context.Context, domain string) (*models.FediInstance, db.Error)
ReadFediInstanceByDomain returns one federated social instance.
func (*CacheMem) ReadFediInstancesPage ¶
func (c *CacheMem) ReadFediInstancesPage(ctx context.Context, index, count int) ([]*models.FediInstance, db.Error)
ReadFediInstancesPage returns a page of federated social instances.
func (*CacheMem) ReadTransaction ¶
func (*CacheMem) ReadTransactionsPage ¶
func (*CacheMem) ResetCache ¶
ResetCache clears all the caches.
func (*CacheMem) TxRollback ¶
func (*CacheMem) UpdateFediAccount ¶
UpdateFediAccount updates the stored federated instance and caches it.
func (*CacheMem) UpdateFediInstance ¶
UpdateFediInstance updates the stored federated instance and caches it.