inmem

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

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

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 New

func New() *Store

New returns an empty store.

func (*Store) APIRestrictions

func (s *Store) APIRestrictions() store.APIRestrictionStore

func (*Store) AfterCommit

func (s *Store) AfterCommit(ctx context.Context, fn func())

AfterCommit implements store.Store.

func (*Store) Archive

func (s *Store) Archive() store.ArchiveStore

Archive implements store.Store.

func (*Store) Blobs

func (s *Store) Blobs() store.BlobIndex

Blobs implements store.Store.

func (*Store) BowerRegistrations

func (s *Store) BowerRegistrations() store.BowerRegistrationStore

BowerRegistrations implements store.Store.

func (*Store) Builds

func (s *Store) Builds() store.BuildStore

Builds implements store.Store.

func (*Store) Bundles

func (s *Store) Bundles() store.BundleStore

Bundles implements store.Store.

func (*Store) Cleanup

func (s *Store) Cleanup() store.CleanupStore

Cleanup implements store.Store.

func (*Store) Close

func (*Store) Close() error

Close implements store.Store.

func (*Store) Configs

func (s *Store) Configs() store.ConfigStore

Configs 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) Groups

func (s *Store) Groups() store.GroupStore

Groups implements store.Store.

func (*Store) Instance

func (s *Store) Instance() store.InstanceStore

Instance implements store.Store.

func (*Store) Items

func (s *Store) Items() store.ItemStore

Items implements store.Store.

func (*Store) Keys

func (s *Store) Keys() store.KeyStore

Keys implements store.Store.

func (*Store) Leases

func (s *Store) Leases() store.LeaseStore

Leases implements store.Store.

func (*Store) Outbox

func (s *Store) Outbox() store.OutboxStore

Outbox implements store.Store.

func (*Store) Packages

func (s *Store) Packages() store.PackageStore

Packages implements store.Store.

func (*Store) Peers

func (s *Store) Peers() store.PeerStore

Peers 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) Repos

func (s *Store) Repos() store.RepoStore

Repos 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) Tokens

func (s *Store) Tokens() store.TokenStore

Tokens implements store.Store.

func (*Store) Trash

func (s *Store) Trash() store.TrashStore

Trash implements store.Store.

func (*Store) Tx

func (s *Store) Tx(ctx context.Context, fn func(context.Context) error) error

Tx implements store.Store.

func (*Store) Uploads

func (s *Store) Uploads() store.UploadStore

Uploads implements store.Store.

func (*Store) Users

func (s *Store) Users() store.UserStore

Users implements store.Store.

func (*Store) Webhooks

func (s *Store) Webhooks() store.WebhookStore

Webhooks implements store.Store.

func (*Store) WorkQueue

func (s *Store) WorkQueue() store.WorkQueue

WorkQueue implements store.Store.

func (*Store) Workers

func (s *Store) Workers() store.WorkerStore

Workers implements store.Store.

Jump to

Keyboard shortcuts

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