cachemem

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ context.Context, d db.DB) (db.DB, error)

New creates a new in memory cache.

Types

type CacheMem

type CacheMem struct {
	// contains filtered or unexported fields
}

CacheMem is an in memory caching middleware for our db interface.

func (CacheMem) Close

func (c CacheMem) Close(ctx context.Context) db.Error

func (CacheMem) CountAccounts

func (c CacheMem) CountAccounts(ctx context.Context) (int64, db.Error)

func (CacheMem) CountAccountsForInstance

func (c CacheMem) CountAccountsForInstance(ctx context.Context, instanceID int64) (int64, db.Error)

func (CacheMem) CountBlocks

func (c CacheMem) CountBlocks(ctx context.Context) (count int64, err db.Error)

func (CacheMem) CountInstances

func (c CacheMem) CountInstances(ctx context.Context) (count int64, err db.Error)

func (CacheMem) CountLogEntries

func (c CacheMem) CountLogEntries(ctx context.Context) (count int64, err db.Error)

func (CacheMem) CreateAccount

func (c CacheMem) CreateAccount(ctx context.Context, account *models.Account) db.Error

func (CacheMem) CreateBlockTX

func (c CacheMem) CreateBlockTX(ctx context.Context, txID db.TxID, blocks ...*models.Block) (err db.Error)

func (CacheMem) CreateConfigTX

func (c CacheMem) CreateConfigTX(ctx context.Context, txID db.TxID, configs ...*models.Config) (err db.Error)

func (CacheMem) CreateInstance

func (c CacheMem) CreateInstance(ctx context.Context, instance *models.Instance) (err db.Error)

func (CacheMem) CreateLogEntryTX

func (c CacheMem) CreateLogEntryTX(ctx context.Context, txID db.TxID, logEntries ...*models.LogEntry) (err db.Error)

func (CacheMem) DeleteBlock

func (c CacheMem) DeleteBlock(ctx context.Context, blocks ...*models.Block) (err db.Error)

func (CacheMem) DeleteConfigTX

func (c CacheMem) DeleteConfigTX(ctx context.Context, txID db.TxID, configs ...*models.Config) (err db.Error)

func (CacheMem) DoMigration

func (c CacheMem) DoMigration(ctx context.Context) db.Error

func (CacheMem) IncAccountLoginCount

func (c CacheMem) IncAccountLoginCount(ctx context.Context, account *models.Account) db.Error

func (CacheMem) ReadAccount

func (c CacheMem) ReadAccount(ctx context.Context, id int64) (*models.Account, db.Error)

func (CacheMem) ReadAccountByUsername

func (c CacheMem) ReadAccountByUsername(ctx context.Context, instanceID int64, username string) (*models.Account, db.Error)

func (CacheMem) ReadAccountsPage

func (c CacheMem) ReadAccountsPage(ctx context.Context, index, count int) ([]*models.Account, db.Error)

func (CacheMem) ReadAccountsWithStaleInfo added in v0.7.0

func (c CacheMem) ReadAccountsWithStaleInfo(ctx context.Context, before time.Time) (accounts []*models.Account, err db.Error)

func (CacheMem) ReadBlock

func (c CacheMem) ReadBlock(ctx context.Context, id int64) (block *models.Block, err db.Error)

func (CacheMem) ReadBlockByDomain

func (c CacheMem) ReadBlockByDomain(ctx context.Context, domain string) (block *models.Block, err db.Error)

func (CacheMem) ReadBlocks

func (c CacheMem) ReadBlocks(ctx context.Context) (blocks []*models.Block, err db.Error)

func (CacheMem) ReadBlocksPage

func (c CacheMem) ReadBlocksPage(ctx context.Context, index, count int) (blocks []*models.Block, err db.Error)

func (CacheMem) ReadConfig

func (c CacheMem) ReadConfig(ctx context.Context, id int64) (config *models.Config, err db.Error)

func (CacheMem) ReadConfigByKey

func (c CacheMem) ReadConfigByKey(ctx context.Context, key models.ConfigKey) (config *models.Config, err db.Error)

func (CacheMem) ReadConfigsForAccountForKeys

func (c CacheMem) ReadConfigsForAccountForKeys(ctx context.Context, accountID int64, keys ...models.ConfigKey) (configs []*models.Config, err db.Error)

func (CacheMem) ReadConfigsForKeysSystem

func (c CacheMem) ReadConfigsForKeysSystem(ctx context.Context, keys ...models.ConfigKey) (configs []*models.Config, err db.Error)

func (CacheMem) ReadConfigsForKeysUser

func (c CacheMem) ReadConfigsForKeysUser(ctx context.Context, keys ...models.ConfigKey) (configs []*models.Config, err db.Error)

func (CacheMem) ReadInstance

func (c CacheMem) ReadInstance(ctx context.Context, id int64) (instance *models.Instance, err db.Error)

func (CacheMem) ReadInstanceByActorIRI

func (c CacheMem) ReadInstanceByActorIRI(ctx context.Context, actorIRI string) (instance *models.Instance, err db.Error)

func (CacheMem) ReadInstanceByDomain

func (c CacheMem) ReadInstanceByDomain(ctx context.Context, domain string) (instance *models.Instance, err db.Error)

func (CacheMem) ReadInstanceByServerHostname

func (c CacheMem) ReadInstanceByServerHostname(ctx context.Context, serverHostname string) (instance *models.Instance, err db.Error)

func (CacheMem) ReadInstances

func (c CacheMem) ReadInstances(ctx context.Context, ids ...int64) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadInstancesPage

func (c CacheMem) ReadInstancesPage(ctx context.Context, index, count int) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadInstancesWhereFollowing

func (c CacheMem) ReadInstancesWhereFollowing(ctx context.Context) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadInstancesWithBlockID

func (c CacheMem) ReadInstancesWithBlockID(ctx context.Context, blockID int64) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadInstancesWithDomainSuffix

func (c CacheMem) ReadInstancesWithDomainSuffix(ctx context.Context, domainSuffix string) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadInstancesWithStaleInfo added in v0.7.0

func (c CacheMem) ReadInstancesWithStaleInfo(ctx context.Context, before time.Time) (instances []*models.Instance, err db.Error)

func (CacheMem) ReadLogEntriesPage

func (c CacheMem) ReadLogEntriesPage(ctx context.Context, index, count int, asc bool) (instances []*models.LogEntry, err db.Error)

func (CacheMem) TxCommit

func (c CacheMem) TxCommit(ctx context.Context, id db.TxID) db.Error

func (CacheMem) TxNew

func (c CacheMem) TxNew(ctx context.Context) (db.TxID, db.Error)

func (CacheMem) TxRollback

func (c CacheMem) TxRollback(ctx context.Context, id db.TxID) db.Error

func (CacheMem) UpdateAccount

func (c CacheMem) UpdateAccount(ctx context.Context, account *models.Account) db.Error

func (CacheMem) UpdateBlockTX

func (c CacheMem) UpdateBlockTX(ctx context.Context, txID db.TxID, blocks ...*models.Block) (err db.Error)

func (CacheMem) UpdateConfigTX

func (c CacheMem) UpdateConfigTX(ctx context.Context, txID db.TxID, configs ...*models.Config) (err db.Error)

func (CacheMem) UpdateInstance

func (c CacheMem) UpdateInstance(ctx context.Context, instance *models.Instance) (err db.Error)

func (CacheMem) UpdateInstanceTX

func (c CacheMem) UpdateInstanceTX(ctx context.Context, txID db.TxID, instance *models.Instance) (err db.Error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL