store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package store opens the engine's MongoDB storage (upstream pkg/storage/mongodb, unmodified) and times the two storage stages of an admission: payload publication, which runs outside the commit transaction, and the overlay-admission-v1 commit itself.

Injecting this Store into the engine switches EVERY submit to the overlay-admission-v1 path (engine.GetAdmissionStorage finds the capability). That is a side effect of the type, not a flag; Open asserts it so the host can never run the legacy commit path by accident.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI      string
	Database string
	Scope    engine.StorageScope
	// Lease is upstream's LeaseDuration; zero keeps its default.
	Lease time.Duration
}

Config is what Open needs.

type Store

type Store struct {
	*mongodb.Store
	// contains filtered or unexported fields
}

Store is the upstream store with the storage stages timed. Every other method is upstream's, promoted.

func Open

func Open(ctx context.Context, cfg Config) (*Store, error)

Open connects, checks that the server is a replica set (multi-document transactions need one), bootstraps upstream's schema and asserts the admission path.

func (*Store) AdmissionStorage

func (s *Store) AdmissionStorage() engine.AdmissionStorage

AdmissionStorage returns the wrapper, so the engine commits through the timed CommitAdmission below.

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Close disconnects the client Open created.

func (*Store) CommitAdmission

func (s *Store) CommitAdmission(ctx context.Context, plan engine.AdmissionCommit) (engine.AdmissionCommitResult, error)

CommitAdmission times upstream's commit as StageCommit.

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

Ping is the readiness check.

func (*Store) PublishPayload

func (s *Store) PublishPayload(ctx context.Context, ref engine.AdmissionPayloadRef, reader io.Reader) error

PublishPayload times upstream's payload publication as StagePayload.

Jump to

Keyboard shortcuts

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