Help us shape the future of Go! Take the 2026 Go Developer Survey

snapshots

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Manager

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

func New

func New(options Options) (*Manager, error)

func (*Manager) AcquireConnection

func (m *Manager) AcquireConnection(reference string) (func(), error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Create

func (*Manager) Delete

func (m *Manager) Delete(context.Context, string) error

func (*Manager) Describe

Describe returns a stored snapshot's base descriptor.

It touches: a by-id read is someone opening the results page, which is exactly the activity sliding expiry tracks, and it is the first request of that page load — a non-touching read would hand back an expires_at already stale relative to the row reads that follow it milliseconds later.

func (*Manager) Get

func (m *Manager) Get(_ context.Context, name string) (query.Profile, error)

func (*Manager) IsVirtual

func (m *Manager) IsVirtual(name string) bool

func (*Manager) List

func (m *Manager) List(context.Context) ([]query.Profile, error)

func (*Manager) ListConnections

func (m *Manager) ListConnections() ([]*models.Connection, error)

func (*Manager) Peek

func (m *Manager) Peek(_ context.Context, name string) (query.Profile, error)

func (*Manager) Prepare

func (m *Manager) Prepare() error

Prepare creates the private root, reloads the snapshots a previous process left behind, and starts the prune loop. Serve calls it at startup; tests and direct callers can create lazily.

It no longer wipes the directory. Persisting each snapshot's metadata beside its rows is what makes a /reconcile/{id} link outlive the process that created it, and a startup wipe would undo exactly that. Anything whose deadline passed while the process was down is dropped during the reload, so the guarantee a client was given still holds.

func (*Manager) ResolveConnection

func (m *Manager) ResolveConnection(_ dbcontext.Context, reference string) (*models.Connection, error)

func (*Manager) Save

func (*Manager) SetMaxAge

func (m *Manager) SetMaxAge(age time.Duration) error

type Options

type Options struct {
	Dir    string
	MaxAge time.Duration
	Now    func() time.Time
}

Jump to

Keyboard shortcuts

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