Documentation
¶
Index ¶
- type Repo
- func (r *Repo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *Repo) DeleteOwnedIfUnreferenced(ctx context.Context, ownerUserID uuid.UUID) error
- func (r *Repo) Exists(ctx context.Context) (bool, error)
- func (r *Repo) Get(ctx context.Context, id uuid.UUID) (domain.PostgresInstance, error)
- func (r *Repo) GetOwned(ctx context.Context, userID uuid.UUID) (sql.Null[domain.PostgresInstance], error)
- func (r *Repo) List(ctx context.Context) ([]domain.PostgresInstance, error)
- func (r *Repo) PickForUser(ctx context.Context, userID uuid.UUID) (domain.PostgresInstance, error)
- func (r *Repo) RandomPick(ctx context.Context) (domain.PostgresInstance, error)
- func (r *Repo) Register(ctx context.Context, host string, port int, adminDatabase, username string, ...) (uuid.UUID, error)
- func (r *Repo) RegisterOwned(ctx context.Context, ownerUserID uuid.UUID, host string, port int, ...) (uuid.UUID, error)
- func (r *Repo) Update(ctx context.Context, id uuid.UUID, host string, port int, ...) error
- func (r *Repo) WithTx(tx postgres.DB) repository.PostgresInstances
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) DeleteOwnedIfUnreferenced ¶
DeleteOwnedIfUnreferenced removes ownerUserID's owned instance row if no vault postgres database references it — see repository.PostgresInstances.DeleteOwnedIfUnreferenced.
func (*Repo) GetOwned ¶
func (r *Repo) GetOwned(ctx context.Context, userID uuid.UUID) (sql.Null[domain.PostgresInstance], error)
GetOwned returns the instance owned by userID, if any — see repository.PostgresInstances.GetOwned.
func (*Repo) PickForUser ¶
PickForUser tries userID's owned instance first, falling back to RandomPick's shared admin pool when they have none — see repository.PostgresInstances.PickForUser.
func (*Repo) RandomPick ¶
func (*Repo) RegisterOwned ¶
func (r *Repo) RegisterOwned( ctx context.Context, ownerUserID uuid.UUID, host string, port int, adminDatabase, username string, passwordPlain []byte, sslMode string, ) (uuid.UUID, error)
RegisterOwned is like Register but stamps owner_user_id — see repository.PostgresInstances.RegisterOwned.
func (*Repo) WithTx ¶
func (r *Repo) WithTx(tx postgres.DB) repository.PostgresInstances
Click to show internal directories.
Click to hide internal directories.