sqlite

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 14 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 sqlite is the SQLite state store of ward: the mirror, the check results and the lands.

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 a mirror.Store on one SQLite file.

func Open

func Open(ctx context.Context, path string) (*Store, error)

Open opens the database at path and creates the tables.

func (*Store) AddResult added in v0.3.0

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

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateUserToken added in v0.4.0

func (s *Store) CreateUserToken(ctx context.Context, hash string, r usertoken.Record) error

func (*Store) Due

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

func (*Store) FinishSeedCleanup added in v0.2.1

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

func (*Store) HasMirror

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

func (*Store) InsertLand added in v0.3.0

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

func (*Store) Land added in v0.3.0

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

func (*Store) Lease added in v0.4.0

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

func (*Store) Leased added in v0.4.0

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

func (*Store) MaxResultID added in v0.3.0

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

func (*Store) NextLands added in v0.5.0

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

func (*Store) OpenRequest added in v0.3.0

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

func (*Store) OpenRequests added in v0.3.0

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

func (*Store) Ping

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

func (*Store) Reconciled

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

func (*Store) RecordFailure

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

func (*Store) RecordHook

func (s *Store) RecordHook(ctx context.Context, hit mirror.Hit, now time.Time) (mirror.HookResult, error)

func (*Store) RecordPage

func (s *Store) RecordPage(ctx context.Context, hits []mirror.Hit, cursor string, now time.Time) error

func (*Store) RecordPush

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

func (*Store) Refs

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

func (*Store) RenewLease added in v0.4.0

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

func (*Store) Request added in v0.3.0

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

func (*Store) Results added in v0.3.0

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

func (*Store) RevokeUserToken added in v0.4.0

func (s *Store) RevokeUserToken(ctx context.Context, id string, at time.Time) error

func (*Store) SaveLand added in v0.3.0

func (s *Store) SaveLand(ctx context.Context, l land.Land) error

func (*Store) Seed added in v0.2.0

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

func (*Store) SeedCleaned added in v0.2.1

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

func (*Store) SeedRefs added in v0.2.0

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

func (*Store) Service

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

func (*Store) SetAccepted added in v0.3.0

func (s *Store) SetAccepted(ctx context.Context, id string, at time.Time) error

func (*Store) SetPushed

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

func (*Store) SetSeed added in v0.2.0

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

func (*Store) SetSeedRef added in v0.2.0

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

func (*Store) SetSubscription

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

func (*Store) StateRefs

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

func (*Store) Stats

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

func (*Store) Supersede added in v0.3.0

func (s *Store) Supersede(ctx context.Context, old string, next check.Request) (bool, error)

func (*Store) UnfinishedKeys added in v0.3.0

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

func (*Store) UserTokenByHash added in v0.4.0

func (s *Store) UserTokenByHash(ctx context.Context, hash string) (usertoken.Record, error)

func (*Store) UserTokens added in v0.4.0

func (s *Store) UserTokens(ctx context.Context) ([]usertoken.Record, error)

Jump to

Keyboard shortcuts

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