memory

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 13 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 memory is the in-memory state store of ward. It implements the same store interfaces as the SQLite store and runs the same conformance suites. Its data lives as long as the value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.14.0

type Option func(*Store)

func WithClock added in v0.14.0

func WithClock(now func() time.Time) Option

WithClock sets the clock that stamps the end of a land and the close of a check request. The default is the wall clock.

type Store

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

Store keeps all state under one mutex, so each method is atomic as the interfaces require.

func New

func New(opts ...Option) *Store

New returns an empty store.

func (*Store) AddResult

func (s *Store) AddResult(_ context.Context, r check.Result) (bool, error)

func (*Store) Classify added in v0.14.0

func (s *Store) Classify(_ context.Context, ev api.Event) (mirror.HookResult, error)

func (*Store) ClearWant added in v0.14.0

func (s *Store) ClearWant(_ context.Context, scope, kind string, version int64) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeferWant added in v0.14.0

func (s *Store) DeferWant(_ context.Context, scope, kind string, version int64, attempts int, next time.Time) error

func (*Store) Due

func (s *Store) Due(_ context.Context, name string, now time.Time) ([]mirror.Ref, time.Time, error)

func (*Store) FinishReset added in v0.14.0

func (s *Store) FinishReset(_ context.Context, id, cursor string, version int64) error

func (*Store) FinishSeed added in v0.14.0

func (s *Store) FinishSeed(_ context.Context, name string) error

func (*Store) FinishSeedCleanup

func (s *Store) FinishSeedCleanup(_ context.Context, name string, refs []string) error

func (*Store) HasMirror

func (s *Store) HasMirror(_ context.Context, name string) (bool, error)

func (*Store) InsertLand

func (s *Store) InsertLand(_ context.Context, l land.Land) error

func (*Store) Land

func (s *Store) Land(_ context.Context, id string) (land.Land, bool, error)

func (*Store) Lease

func (s *Store) Lease(_ context.Context, repos []string, kid, leaseID string, now, until time.Time) (check.Request, bool, error)

func (*Store) Leased

func (s *Store) Leased(_ context.Context, requestID, kid string) (bool, error)

func (*Store) MaxResultID

func (s *Store) MaxResultID(context.Context) (int64, error)

func (*Store) MirrorEpoch added in v0.14.0

func (s *Store) MirrorEpoch(_ context.Context, name string) (int64, error)

func (*Store) NextLands

func (s *Store) NextLands(_ context.Context, key land.Key, n int) ([]land.Land, error)

func (*Store) OpenRequest

func (s *Store) OpenRequest(_ context.Context, r check.Request) (check.Request, bool, error)

func (*Store) OpenRequests

func (s *Store) OpenRequests(context.Context) ([]check.Request, error)

func (*Store) Ping

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

func (*Store) Prune added in v0.14.0

func (s *Store) Prune(_ context.Context, before time.Time) (int64, error)

func (*Store) Reconciled

func (s *Store) Reconciled(_ context.Context, name string, targets map[string]string, now time.Time, version, epoch int64) error

func (*Store) RecordFailure

func (s *Store) RecordFailure(_ context.Context, name, ref string, version int64, class mirror.Class, message string, next, now time.Time) error

func (*Store) RecordHook

func (s *Store) RecordHook(_ context.Context, ev api.Event) (mirror.HookResult, error)

func (*Store) RecordPage

func (s *Store) RecordPage(_ context.Context, events []api.Event, cursor string) error

func (*Store) RecordPush

func (s *Store) RecordPush(_ context.Context, name, ref string, version int64, pushed string, now time.Time) error

func (*Store) Refs

func (s *Store) Refs(_ context.Context, name, after string, limit int) ([]mirror.Ref, error)

func (*Store) RenewLease

func (s *Store) RenewLease(_ context.Context, leaseID, kid string, repos []string, until time.Time) (bool, error)

func (*Store) Request

func (s *Store) Request(_ context.Context, id string) (check.Request, bool, error)

func (*Store) RequestWant added in v0.14.0

func (s *Store) RequestWant(_ context.Context, scope, kind, message string, tag int64) error

func (*Store) Results

func (s *Store) Results(_ context.Context, repo, tree, hash, env, keyBase string) ([]check.Result, error)

func (*Store) SaveLands added in v0.13.0

func (s *Store) SaveLands(_ context.Context, ls ...land.Land) error

func (*Store) Seed

func (s *Store) Seed(_ context.Context, name string) (string, error)

func (*Store) SeedCleaned

func (s *Store) SeedCleaned(_ context.Context, name string) (bool, error)

func (*Store) SeedRefs

func (s *Store) SeedRefs(_ context.Context, name string) (map[string]mirror.SeedRef, error)

func (*Store) Service

func (s *Store) Service(context.Context) (mirror.Service, error)

func (*Store) SetPushed

func (s *Store) SetPushed(_ context.Context, name, ref, pushed string) error

func (*Store) SetSeed

func (s *Store) SetSeed(_ context.Context, name, state string) error

func (*Store) SetSeedRef

func (s *Store) SetSeedRef(_ context.Context, name, ref string, r mirror.SeedRef) error

func (*Store) SetSubscription

func (s *Store) SetSubscription(_ context.Context, id, cursor string, clearSeq bool) error

func (*Store) StateRefs

func (s *Store) StateRefs(_ context.Context, name string) ([]string, error)

func (*Store) Stats

func (s *Store) Stats(context.Context) ([]mirror.Stats, error)

func (*Store) Supersede

func (s *Store) Supersede(_ context.Context, old string, next check.Request, now time.Time) (bool, error)

func (*Store) Triggers added in v0.14.0

func (s *Store) Triggers(_ context.Context, name string, events []api.Event, now time.Time) error

func (*Store) UnfinishedKeys

func (s *Store) UnfinishedKeys(context.Context) ([]land.Key, error)

func (*Store) Wants added in v0.14.0

func (s *Store) Wants(context.Context) ([]mirror.Want, error)

Jump to

Keyboard shortcuts

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