Documentation
¶
Overview ¶
Package inmem is the reference in-memory implementation of pkg/store.
Design ¶
Each table is a map of Go values. Values are deep-copied on the way in and on the way out, so callers never share memory with the store, and on the way in every time is normalised to UTC microseconds and every duration to milliseconds, exactly what the SQL columns keep. One cancellable gate serialises access; Tx holds it for the whole callback (calls made with the transaction's context skip re-locking) and restores a snapshot of every table when the callback fails, giving the all-or-nothing behaviour of the SQL backends. It serves unit tests and embedders that need no durability.
Index ¶
- type Store
- func (s *Store) APIRestrictions() store.APIRestrictionStore
- func (s *Store) AfterCommit(ctx context.Context, fn func())
- func (s *Store) Archive() store.ArchiveStore
- func (s *Store) Blobs() store.BlobIndex
- func (s *Store) BowerRegistrations() store.BowerRegistrationStore
- func (s *Store) Builds() store.BuildStore
- func (s *Store) Bundles() store.BundleStore
- func (s *Store) Cleanup() store.CleanupStore
- func (*Store) Close() error
- func (s *Store) Configs() store.ConfigStore
- func (s *Store) Distribution() store.DistributionStore
- func (s *Store) Federation() store.FederationStore
- func (s *Store) GitLFSLocks() store.GitLFSLockStore
- func (s *Store) Groups() store.GroupStore
- func (s *Store) Instance() store.InstanceStore
- func (s *Store) Items() store.ItemStore
- func (s *Store) Keys() store.KeyStore
- func (s *Store) Leases() store.LeaseStore
- func (s *Store) Outbox() store.OutboxStore
- func (s *Store) Packages() store.PackageStore
- func (s *Store) Peers() store.PeerStore
- func (s *Store) Permissions() store.PermissionStore
- func (s *Store) Platform() store.PlatformStore
- func (s *Store) Projects() store.ProjectStore
- func (s *Store) RemoteCache() store.RemoteCacheStore
- func (s *Store) Replays() store.ReplayStore
- func (s *Store) Replicas() store.ReplicaIndex
- func (s *Store) Replications() store.ReplicationStore
- func (s *Store) Repos() store.RepoStore
- func (s *Store) RequestBudgets() store.RequestBudgetStore
- func (s *Store) Settings() store.SettingsStore
- func (s *Store) Tokens() store.TokenStore
- func (s *Store) Trash() store.TrashStore
- func (s *Store) Tx(ctx context.Context, fn func(context.Context) error) error
- func (s *Store) Uploads() store.UploadStore
- func (s *Store) Users() store.UserStore
- func (s *Store) Webhooks() store.WebhookStore
- func (s *Store) WorkQueue() store.WorkQueue
- func (s *Store) Workers() store.WorkerStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory store.Store. The zero value is not usable; call New.
func (*Store) APIRestrictions ¶
func (s *Store) APIRestrictions() store.APIRestrictionStore
func (*Store) AfterCommit ¶
AfterCommit implements store.Store.
func (*Store) Archive ¶
func (s *Store) Archive() store.ArchiveStore
Archive implements store.Store.
func (*Store) BowerRegistrations ¶
func (s *Store) BowerRegistrations() store.BowerRegistrationStore
BowerRegistrations implements store.Store.
func (*Store) Cleanup ¶
func (s *Store) Cleanup() store.CleanupStore
Cleanup implements store.Store.
func (*Store) Distribution ¶
func (s *Store) Distribution() store.DistributionStore
Distribution implements store.Store.
func (*Store) Federation ¶
func (s *Store) Federation() store.FederationStore
Federation implements store.Store.
func (*Store) GitLFSLocks ¶
func (s *Store) GitLFSLocks() store.GitLFSLockStore
GitLFSLocks implements store.Store.
func (*Store) Instance ¶
func (s *Store) Instance() store.InstanceStore
Instance implements store.Store.
func (*Store) Packages ¶
func (s *Store) Packages() store.PackageStore
Packages implements store.Store.
func (*Store) Permissions ¶
func (s *Store) Permissions() store.PermissionStore
Permissions implements store.Store.
func (*Store) Platform ¶
func (s *Store) Platform() store.PlatformStore
Platform implements store.Store.
func (*Store) Projects ¶
func (s *Store) Projects() store.ProjectStore
Projects implements store.Store.
func (*Store) RemoteCache ¶
func (s *Store) RemoteCache() store.RemoteCacheStore
RemoteCache implements store.Store.
func (*Store) Replays ¶
func (s *Store) Replays() store.ReplayStore
func (*Store) Replicas ¶
func (s *Store) Replicas() store.ReplicaIndex
Replicas implements store.Store.
func (*Store) Replications ¶
func (s *Store) Replications() store.ReplicationStore
Replications implements store.Store.
func (*Store) RequestBudgets ¶
func (s *Store) RequestBudgets() store.RequestBudgetStore
func (*Store) Settings ¶
func (s *Store) Settings() store.SettingsStore
Settings implements store.Store.
func (*Store) Webhooks ¶
func (s *Store) Webhooks() store.WebhookStore
Webhooks implements store.Store.