Documentation
¶
Overview ¶
Package sqlite is the SQLite state store of ward: the mirror, the check results and the lands.
Index ¶
- type Option
- type Store
- func (s *Store) AddResult(ctx context.Context, r check.Result) (bool, error)
- func (s *Store) Close() error
- func (s *Store) CreateUserToken(ctx context.Context, hash string, r usertoken.Record) error
- func (s *Store) Due(ctx context.Context, name string, now time.Time) ([]mirror.Ref, time.Time, error)
- func (s *Store) FinishSeedCleanup(ctx context.Context, name string, refs []string) error
- func (s *Store) HasMirror(ctx context.Context, name string) (bool, error)
- func (s *Store) InsertLand(ctx context.Context, l land.Land) error
- func (s *Store) Land(ctx context.Context, id string) (land.Land, bool, error)
- func (s *Store) Lease(ctx context.Context, repos []string, kid, leaseID string, now, until time.Time) (check.Request, bool, error)
- func (s *Store) Leased(ctx context.Context, requestID, kid string) (bool, error)
- func (s *Store) MaxResultID(ctx context.Context) (int64, error)
- func (s *Store) NextLands(ctx context.Context, key land.Key, n int) ([]land.Land, error)
- func (s *Store) OpenRequest(ctx context.Context, r check.Request) (check.Request, bool, error)
- func (s *Store) OpenRequests(ctx context.Context) ([]check.Request, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Prune(ctx context.Context, before time.Time) (int64, error)
- func (s *Store) Reconciled(ctx context.Context, name string, targets map[string]string, now time.Time) error
- func (s *Store) RecordFailure(ctx context.Context, name, ref string, version int64, class mirror.Class, ...) error
- func (s *Store) RecordHook(ctx context.Context, hit mirror.Hit, now time.Time) (mirror.HookResult, error)
- func (s *Store) RecordPage(ctx context.Context, hits []mirror.Hit, cursor string, now time.Time) error
- func (s *Store) RecordPush(ctx context.Context, name, ref string, version int64, pushed string, ...) error
- func (s *Store) Refs(ctx context.Context, name, after string, limit int) ([]mirror.Ref, error)
- func (s *Store) RenewLease(ctx context.Context, leaseID, kid string, repos []string, until time.Time) (bool, error)
- func (s *Store) Request(ctx context.Context, id string) (check.Request, bool, error)
- func (s *Store) Results(ctx context.Context, repo, tree, hash, env string) ([]check.Result, error)
- func (s *Store) RevokeUserToken(ctx context.Context, id string, at time.Time) error
- func (s *Store) SaveLand(ctx context.Context, l land.Land) error
- func (s *Store) Seed(ctx context.Context, name string) (string, error)
- func (s *Store) SeedCleaned(ctx context.Context, name string) (bool, error)
- func (s *Store) SeedRefs(ctx context.Context, name string) (map[string]mirror.SeedRef, error)
- func (s *Store) Service(ctx context.Context) (mirror.Service, error)
- func (s *Store) SetPushed(ctx context.Context, name, ref, pushed string) error
- func (s *Store) SetSeed(ctx context.Context, name, state string) error
- func (s *Store) SetSeedRef(ctx context.Context, name, ref string, r mirror.SeedRef) error
- func (s *Store) SetSubscription(ctx context.Context, id, cursor string, clearSeq bool) error
- func (s *Store) StateRefs(ctx context.Context, name string) ([]string, error)
- func (s *Store) Stats(ctx context.Context) ([]mirror.Stats, error)
- func (s *Store) Supersede(ctx context.Context, old string, next check.Request, now time.Time) (bool, error)
- func (s *Store) UnfinishedKeys(ctx context.Context) ([]land.Key, error)
- func (s *Store) UserTokenByHash(ctx context.Context, hash string) (usertoken.Record, error)
- func (s *Store) UserTokens(ctx context.Context) ([]usertoken.Record, error)
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 the state of ward on one SQLite file: the mirror, the check requests and results, the lands and the user tokens.
func (*Store) CreateUserToken ¶
func (*Store) FinishSeedCleanup ¶
func (*Store) OpenRequest ¶
func (*Store) OpenRequests ¶
func (*Store) Prune ¶
Prune deletes the lands that ended and the check requests that closed before the time before, and the leases that expired before it and belong to no open request. A lease of an open request stays, because Leased and RenewLease read it. It returns the number of rows deleted.