Documentation
¶
Overview ¶
Package postgres is the PostgreSQL backend of meta.Store.
Index ¶
- func Migrate(ctx context.Context, pool *pgxpool.Pool) error
- type Store
- func (s *Store) AckLand(ctx context.Context, repo, id string) error
- func (s *Store) AcquireLandLease(ctx context.Context, repo, ref, owner string, now, until time.Time) (time.Time, error)
- func (s *Store) AcquireLease(ctx context.Context, id string, partition int, owner string, ...) (meta.Lease, error)
- func (s *Store) AdvanceCursor(ctx context.Context, id string, partition int, owner string, cursor int64) error
- func (s *Store) BeginDelete(ctx context.Context, repo string, keys []string, ...) ([]string, error)
- func (s *Store) Claim(ctx context.Context, id string, epoch uint64, owner, repo string) (meta.Workspace, error)
- func (s *Store) ClaimLands(ctx context.Context, repo, ref, owner string, now time.Time, limit int) ([]meta.LandItem, error)
- func (s *Store) Close()
- func (s *Store) CreateRepo(ctx context.Context, r meta.Repo, repoText, commit string) error
- func (s *Store) CreateSubscription(ctx context.Context, sub meta.Subscription) (meta.Subscription, error)
- func (s *Store) CreateUserToken(ctx context.Context, hash string, t meta.UserToken) error
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) DeleteRef(ctx context.Context, ws string, epoch uint64, repo, name string, expect int64) error
- func (s *Store) DeleteSubscription(ctx context.Context, id string) error
- func (s *Store) EnqueueLand(ctx context.Context, r meta.LandRequest, now time.Time) (meta.LandItem, error)
- func (s *Store) EventHeads(ctx context.Context) ([]int64, error)
- func (s *Store) Events(ctx context.Context, partition int, after int64, limit int) ([]meta.Event, error)
- func (s *Store) FinishLands(ctx context.Context, repo, ref, owner string, now time.Time, ...) error
- func (s *Store) Flush(ctx context.Context, ws string, epoch uint64, generation int64, ...) error
- func (s *Store) ForgetRetired(ctx context.Context, repo string, keys []string) error
- func (s *Store) LandItem(ctx context.Context, repo, id string) (meta.LandItem, error)
- func (s *Store) LandLogSince(ctx context.Context, repo, ref, base string, limit int) ([]meta.LandLogRow, error)
- func (s *Store) LandPending(ctx context.Context) ([]meta.LandKey, error)
- func (s *Store) LandRef(ctx context.Context, m meta.LandMove, owner string, now time.Time) (meta.Ref, error)
- func (s *Store) Live(ctx context.Context, id string, epoch uint64, repo string) error
- func (s *Store) Manifest(ctx context.Context, repo string) (meta.Manifest, error)
- func (s *Store) ManifestRepos(ctx context.Context) ([]string, error)
- func (s *Store) MergeDeleteRef(ctx context.Context, repo, name string, expect int64) error
- func (s *Store) MergeRef(ctx context.Context, repo, name string, expect int64, sha string) (meta.Ref, error)
- func (s *Store) OpHeads(ctx context.Context, ws string) (meta.OpHeads, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) ProtectedRefs(ctx context.Context, repo string) ([]string, error)
- func (s *Store) PruneEvents(ctx context.Context, before time.Time) error
- func (s *Store) PruneLands(ctx context.Context, before time.Time) error
- func (s *Store) Ref(ctx context.Context, repo, name string) (meta.Ref, error)
- func (s *Store) Refs(ctx context.Context, repo string) ([]meta.Ref, error)
- func (s *Store) ReleaseLandLease(ctx context.Context, repo, ref, owner string) error
- func (s *Store) Repo(ctx context.Context, path string) (meta.Repo, error)
- func (s *Store) Report(ctx context.Context, ws string, epoch uint64, repo string, generation int64, ...) error
- func (s *Store) Repos(ctx context.Context) ([]meta.Repo, error)
- func (s *Store) RetireFiles(ctx context.Context, repo string, keys []string, at time.Time) error
- func (s *Store) RetiredFiles(ctx context.Context, repo string) ([]meta.Retired, error)
- func (s *Store) RevokeUserToken(ctx context.Context, id string) error
- func (s *Store) SetProtectedRefs(ctx context.Context, repo string, patterns []string) error
- func (s *Store) Subscriptions(ctx context.Context) ([]meta.Subscription, error)
- func (s *Store) SwapManifest(ctx context.Context, repo string, expect int64, body []byte) (int64, error)
- func (s *Store) SwapOpHeads(ctx context.Context, ws string, epoch uint64, repo string, expect int64, ...) (meta.OpHeads, error)
- func (s *Store) SwapRef(ctx context.Context, ws string, epoch uint64, repo, name string, expect int64, ...) (meta.Ref, error)
- func (s *Store) UpdateRef(ctx context.Context, repo, name, old, new, kind string) (meta.Ref, error)
- func (s *Store) UpdateSubscription(ctx context.Context, sub meta.Subscription) (meta.Subscription, error)
- func (s *Store) UserTokenByHash(ctx context.Context, hash string) (meta.UserToken, error)
- func (s *Store) UserTokens(ctx context.Context) ([]meta.UserToken, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
Store keeps the metadata in the schema of Pool.
func (*Store) AcquireLandLease ¶
func (*Store) AcquireLease ¶
func (*Store) AdvanceCursor ¶
func (*Store) BeginDelete ¶
func (*Store) ClaimLands ¶
func (*Store) CreateRepo ¶
func (*Store) CreateSubscription ¶
func (s *Store) CreateSubscription(ctx context.Context, sub meta.Subscription) (meta.Subscription, error)
func (*Store) CreateUserToken ¶
func (*Store) DeleteSubscription ¶
func (*Store) EnqueueLand ¶
func (*Store) Events ¶
func (s *Store) Events(ctx context.Context, partition int, after int64, limit int) ([]meta.Event, error)
Events reads the rows first and the floor second, so a prune between the reads gives ErrEventsPruned and never a silent gap.
func (*Store) FinishLands ¶
func (*Store) ForgetRetired ¶
func (*Store) LandLogSince ¶
func (*Store) LandPending ¶
func (*Store) ManifestRepos ¶ added in v0.22.1
func (*Store) MergeDeleteRef ¶
func (*Store) ProtectedRefs ¶
func (*Store) PruneEvents ¶
func (*Store) ReleaseLandLease ¶
func (*Store) RetireFiles ¶
func (*Store) RetiredFiles ¶
func (*Store) RevokeUserToken ¶
func (*Store) SetProtectedRefs ¶
func (*Store) Subscriptions ¶
func (*Store) SwapManifest ¶
func (*Store) SwapOpHeads ¶
func (*Store) UpdateRef ¶
UpdateRef compares on the commit of the ref instead of its generation. The write and its event commit together.
func (*Store) UpdateSubscription ¶
func (s *Store) UpdateSubscription(ctx context.Context, sub meta.Subscription) (meta.Subscription, error)