accountsync

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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 accountsync writes the caller accounts the plans call for: it reads the pending account places off each published plan view and creates, closes or reopens their rows through the account store. The rows come back to the plans through the usual change feed. Every pod runs one; the writes are idempotent, so pods racing on one place converge on one row.

Out of scope: deciding what should exist (app/plan), deleting accounts (the foreign keys drop them with their team, project, user or service account), and provider accounts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	EnsureManaged(ctx context.Context, want *account.Account) (string, error)
	SetMembership(ctx context.Context, a *account.Account, closed, followsRoleBindings bool) error
}

Store is the account-store surface the writer needs; *account.Store satisfies it.

type Syncer

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

Syncer applies pending account places. OnPublish only hands the latest list over, so the engine's hooks never wait on Postgres.

func New

func New(s Store) *Syncer

New returns a Syncer writing through s.

func (*Syncer) OnPublish

func (s *Syncer) OnPublish(v *engine.View, _ engine.PublishStats)

OnPublish takes the view's pending places; the newest list replaces one not yet worked.

func (*Syncer) Run

func (s *Syncer) Run(ctx context.Context)

Run works pending lists until ctx ends.

Jump to

Keyboard shortcuts

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