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) AcquireLandLease(ctx context.Context, repo, ref, owner string, now, until time.Time) error
- func (s *Store) AcquireLease(ctx context.Context, id string, partition int, owner string, ...) (meta.Lease, error)
- func (s *Store) AddPack(ctx context.Context, repo, packID string, bytes int64) error
- func (s *Store) AdvanceCursor(ctx context.Context, id string, partition int, owner string, cursor int64) 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) 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) 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) 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) Packs(ctx context.Context, repo string) ([]meta.Pack, 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) SetProtectedRefs(ctx context.Context, repo string, patterns []string) error
- func (s *Store) Subscriptions(ctx context.Context) ([]meta.Subscription, 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)
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) ClaimLands ¶
func (*Store) CreateRepo ¶
func (*Store) CreateSubscription ¶
func (s *Store) CreateSubscription(ctx context.Context, sub meta.Subscription) (meta.Subscription, error)
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.