Documentation
¶
Index ¶
- type Service
- func (s *Service) AcceptInvite(ctx context.Context, token string) error
- func (s *Service) AddMember(ctx context.Context, vaultID, targetUserUuid uuid.UUID, role artel_q.VaultRole) error
- func (s *Service) CreateInviteLink(ctx context.Context, vaultID uuid.UUID, role artel_q.VaultRole) (domain.VaultInvite, error)
- func (s *Service) CreateVault(ctx context.Context, vaultName string) (domain.Vault, error)
- func (s *Service) DeleteVault(ctx context.Context, vaultID uuid.UUID) error
- func (s *Service) DisablePostgresDatabase(ctx context.Context, vaultID uuid.UUID) error
- func (s *Service) EnablePostgresDatabase(ctx context.Context, vaultID uuid.UUID) (domain.VaultPostgresDatabase, error)
- func (s *Service) GetPostgresDatabase(ctx context.Context, vaultID uuid.UUID) (sql.Null[domain.VaultPostgresDatabase], error)
- func (s *Service) GetVault(ctx context.Context, vaultID uuid.UUID) (domain.Vault, error)
- func (s *Service) LinkS3Bucket(ctx context.Context, vaultID uuid.UUID, s3InstanceID *uuid.UUID, ...) error
- func (s *Service) ListInviteLinks(ctx context.Context, vaultID uuid.UUID) ([]domain.VaultInvite, error)
- func (s *Service) ListMembers(ctx context.Context, vaultID uuid.UUID) ([]domain.VaultMemberInfo, error)
- func (s *Service) ListVaults(ctx context.Context) ([]domain.Vault, error)
- func (s *Service) PublishVault(ctx context.Context, vaultID uuid.UUID, slug string) (domain.Vault, error)
- func (s *Service) RemoveMember(ctx context.Context, vaultID, targetUserUuid uuid.UUID) error
- func (s *Service) RevokeInviteLink(ctx context.Context, inviteID uuid.UUID) error
- func (s *Service) SetUseCouchDBForBinaries(ctx context.Context, vaultID uuid.UUID, useCouchDB bool) error
- func (s *Service) UnlinkS3Bucket(ctx context.Context, vaultID uuid.UUID) error
- func (s *Service) UnpublishVault(ctx context.Context, vaultID uuid.UUID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( repo repository.Repo, subscriptions service.SubscriptionService, ) *Service
func (*Service) AcceptInvite ¶
func (*Service) CreateInviteLink ¶
func (*Service) CreateVault ¶
func (*Service) DeleteVault ¶
func (*Service) DisablePostgresDatabase ¶ added in v1.0.15
DisablePostgresDatabase best-effort drops vaultID's provisioned database+role (tolerating a server that's gone or unreachable — DropDatabase/DropRole are already IF EXISTS/idempotent, see vaultpg.AdminClient), then deletes the row. No-op if Postgres was never enabled for this vault. Only the vault owner may disable it, mirroring PublishVault/UnpublishVault's owner check for other destructive per-vault settings.
func (*Service) EnablePostgresDatabase ¶ added in v1.0.15
func (s *Service) EnablePostgresDatabase(ctx context.Context, vaultID uuid.UUID) (domain.VaultPostgresDatabase, error)
EnablePostgresDatabase provisions a Postgres database+role for vaultID on a pool instance resolved via postgresInstancesRepo.PickForUser (prefers the caller's BYOK postgres connection, falling back to the shared admin pool). The vaultPostgresRepo row is created up front with status=provisioning (see repository.VaultPostgresDatabases.Create) before the live provisioning calls run, so a mid-flight failure leaves a retryable/inspectable 'error' row rather than silently returning an error with no persisted trace — mirrors the Workbench provisioning->ready/error lifecycle.
func (*Service) GetPostgresDatabase ¶ added in v1.0.15
func (s *Service) GetPostgresDatabase(ctx context.Context, vaultID uuid.UUID) (sql.Null[domain.VaultPostgresDatabase], error)
GetPostgresDatabase returns vaultID's Postgres database row, Valid: false when Postgres has never been enabled for this vault.
func (*Service) LinkS3Bucket ¶
func (s *Service) LinkS3Bucket(ctx context.Context, vaultID uuid.UUID, s3InstanceID *uuid.UUID, bucketName string) error
LinkS3Bucket links vaultID to an S3 bucket on s3InstanceID. When s3InstanceID is nil, the instance is auto-resolved via s3InstancesRepo.PickForUser (prefers the caller's BYOK s3 connection, falling back to the shared admin pool) instead of requiring an explicit id.