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 ¶
- type Config
- type Store
- func (s *Store) AdmissionStorage() engine.AdmissionStorage
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) CommitAdmission(ctx context.Context, plan engine.AdmissionCommit) (engine.AdmissionCommitResult, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) PublishPayload(ctx context.Context, ref engine.AdmissionPayloadRef, reader io.Reader) error
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 ¶
Store is the upstream store with the storage stages timed. Every other method is upstream's, promoted.
func Open ¶
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) CommitAdmission ¶
func (s *Store) CommitAdmission(ctx context.Context, plan engine.AdmissionCommit) (engine.AdmissionCommitResult, error)
CommitAdmission times upstream's commit as StageCommit.
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.