postgres

package
v0.0.0-...-bc4cf0a Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(connStr string) (*sql.DB, error)

func OpenTestDB

func OpenTestDB(t *testing.T) *sql.DB

func TerminateTestContainer

func TerminateTestContainer()

Types

type AuthMethodRepo

type AuthMethodRepo struct {
	DB *sql.DB
}

AuthMethodRepo implements domain.AuthMethodRepository backed by Postgres. Unlike other repos in this package, it operates on *sql.DB directly because auth method operations do not participate in cross-repo transactions.

func (*AuthMethodRepo) Get

func (*AuthMethodRepo) List

func (*AuthMethodRepo) Save

func (r *AuthMethodRepo) Save(ctx context.Context, method domain.AuthMethod) error

type DeliveryRepo

type DeliveryRepo struct {
	DB *sql.Tx
}

DeliveryRepo implements domain.DeliveryRepository backed by Postgres.

func (*DeliveryRepo) DeleteByFulfillment

func (r *DeliveryRepo) DeleteByFulfillment(ctx context.Context, fID domain.FulfillmentID) error

func (*DeliveryRepo) Get

func (*DeliveryRepo) GetByFulfillmentTarget

func (r *DeliveryRepo) GetByFulfillmentTarget(ctx context.Context, fID domain.FulfillmentID, tgtID domain.TargetID) (domain.Delivery, error)

func (*DeliveryRepo) ListActive

func (r *DeliveryRepo) ListActive(ctx context.Context, targetIDs []domain.TargetID) ([]domain.Delivery, error)

func (*DeliveryRepo) ListByFulfillment

func (r *DeliveryRepo) ListByFulfillment(ctx context.Context, fID domain.FulfillmentID) ([]domain.Delivery, error)

func (*DeliveryRepo) Put

type DeploymentRepo

type DeploymentRepo struct {
	DB *sql.Tx
}

DeploymentRepo implements domain.DeploymentRepository backed by Postgres.

func (*DeploymentRepo) Create

func (*DeploymentRepo) Delete

func (*DeploymentRepo) Get

func (*DeploymentRepo) GetView

func (*DeploymentRepo) ListView

func (r *DeploymentRepo) ListView(ctx context.Context) ([]domain.DeploymentView, error)

type FulfillmentRepo

type FulfillmentRepo struct {
	DB *sql.Tx
}

FulfillmentRepo implements domain.FulfillmentRepository backed by Postgres.

func (*FulfillmentRepo) Create

func (*FulfillmentRepo) Delete

func (*FulfillmentRepo) Get

func (*FulfillmentRepo) Update

type InventoryRepo

type InventoryRepo struct {
	DB *sql.Tx
}

InventoryRepo implements domain.InventoryRepository backed by Postgres.

func (*InventoryRepo) Create

func (r *InventoryRepo) Create(ctx context.Context, item domain.InventoryItem) error

func (*InventoryRepo) CreateOrUpdate

func (r *InventoryRepo) CreateOrUpdate(ctx context.Context, item domain.InventoryItem) error

func (*InventoryRepo) Delete

func (*InventoryRepo) Get

func (*InventoryRepo) List

func (*InventoryRepo) ListByType

func (*InventoryRepo) Update

func (r *InventoryRepo) Update(ctx context.Context, item domain.InventoryItem) error

type ManagedResourceRepo

type ManagedResourceRepo struct {
	DB interface {
		ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
		QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
		QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	}
}

ManagedResourceRepo implements domain.ManagedResourceRepository for Postgres.

func (*ManagedResourceRepo) CreateInstance

func (r *ManagedResourceRepo) CreateInstance(ctx context.Context, mr *domain.ManagedResource) error

func (*ManagedResourceRepo) CreateType

func (*ManagedResourceRepo) DeleteInstance

func (*ManagedResourceRepo) DeleteIntents

func (*ManagedResourceRepo) DeleteType

func (*ManagedResourceRepo) GetInstance

func (*ManagedResourceRepo) GetIntent

func (*ManagedResourceRepo) GetType

func (*ManagedResourceRepo) GetView

func (*ManagedResourceRepo) ListTypes

func (*ManagedResourceRepo) ListViewsByType

type ResourceIdentityRepo

type ResourceIdentityRepo struct {
	DB *sql.Tx
}

ResourceIdentityRepo implements domain.ResourceIdentityRepository backed by Postgres.

func (*ResourceIdentityRepo) Create

func (*ResourceIdentityRepo) Get

func (*ResourceIdentityRepo) GetByName

func (*ResourceIdentityRepo) GetRepresentation

func (*ResourceIdentityRepo) ListByCollection

func (r *ResourceIdentityRepo) ListByCollection(ctx context.Context, collection domain.CollectionID) ([]*domain.PlatformResource, error)

func (*ResourceIdentityRepo) ResolveAlias

func (*ResourceIdentityRepo) Update

type SignerEnrollmentRepo

type SignerEnrollmentRepo struct {
	DB *sql.Tx
}

SignerEnrollmentRepo implements domain.SignerEnrollmentRepository backed by Postgres.

func (*SignerEnrollmentRepo) Create

func (*SignerEnrollmentRepo) Get

func (*SignerEnrollmentRepo) ListBySubject

type Store

type Store struct {
	DB *sql.DB
}

Store implements domain.Store backed by Postgres.

func (*Store) Begin

func (s *Store) Begin(ctx context.Context) (domain.Tx, error)

func (*Store) BeginReadOnly

func (s *Store) BeginReadOnly(ctx context.Context) (domain.Tx, error)

type TargetRepo

type TargetRepo struct {
	DB *sql.Tx
}

TargetRepo implements domain.TargetRepository backed by Postgres.

func (*TargetRepo) Create

func (r *TargetRepo) Create(ctx context.Context, t domain.TargetInfo) error

func (*TargetRepo) CreateOrUpdate

func (r *TargetRepo) CreateOrUpdate(ctx context.Context, t domain.TargetInfo) error

func (*TargetRepo) Delete

func (r *TargetRepo) Delete(ctx context.Context, id domain.TargetID) error

func (*TargetRepo) Get

func (*TargetRepo) List

func (r *TargetRepo) List(ctx context.Context) ([]domain.TargetInfo, error)

type VaultStore

type VaultStore struct {
	DB *sql.DB
}

VaultStore implements domain.Vault backed by Postgres. It operates on *sql.DB directly (not within the transactional Store) because vault operations are independent of domain entity transactions.

func (*VaultStore) Delete

func (v *VaultStore) Delete(ctx context.Context, ref domain.SecretRef) error

func (*VaultStore) Get

func (v *VaultStore) Get(ctx context.Context, ref domain.SecretRef) ([]byte, error)

func (*VaultStore) Put

func (v *VaultStore) Put(ctx context.Context, ref domain.SecretRef, value []byte) error

Jump to

Keyboard shortcuts

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