Documentation
¶
Overview ¶
Package repository implements data persistence for secret management. Repositories support both PostgreSQL and MySQL with automatic versioning and soft deletion.
Index ¶
- type MySQLSecretRepository
- func (m *MySQLSecretRepository) Create(ctx context.Context, secret *secretsDomain.Secret) error
- func (m *MySQLSecretRepository) Delete(ctx context.Context, secretID uuid.UUID) error
- func (m *MySQLSecretRepository) GetByPath(ctx context.Context, path string) (*secretsDomain.Secret, error)
- func (m *MySQLSecretRepository) GetByPathAndVersion(ctx context.Context, path string, version uint) (*secretsDomain.Secret, error)
- type PostgreSQLSecretRepository
- func (p *PostgreSQLSecretRepository) Create(ctx context.Context, secret *secretsDomain.Secret) error
- func (p *PostgreSQLSecretRepository) Delete(ctx context.Context, secretID uuid.UUID) error
- func (p *PostgreSQLSecretRepository) GetByPath(ctx context.Context, path string) (*secretsDomain.Secret, error)
- func (p *PostgreSQLSecretRepository) GetByPathAndVersion(ctx context.Context, path string, version uint) (*secretsDomain.Secret, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLSecretRepository ¶
type MySQLSecretRepository struct {
// contains filtered or unexported fields
}
MySQLSecretRepository implements Secret persistence for MySQL databases.
func NewMySQLSecretRepository ¶
func NewMySQLSecretRepository(db *sql.DB) *MySQLSecretRepository
NewMySQLSecretRepository creates a new MySQL Secret repository instance.
func (*MySQLSecretRepository) Create ¶
func (m *MySQLSecretRepository) Create(ctx context.Context, secret *secretsDomain.Secret) error
Create inserts a new secret into the MySQL database.
func (*MySQLSecretRepository) Delete ¶
Delete performs a soft delete on a secret by setting the DeletedAt timestamp.
func (*MySQLSecretRepository) GetByPath ¶
func (m *MySQLSecretRepository) GetByPath( ctx context.Context, path string, ) (*secretsDomain.Secret, error)
GetByPath retrieves the latest non-deleted version of a secret by its path.
func (*MySQLSecretRepository) GetByPathAndVersion ¶
func (m *MySQLSecretRepository) GetByPathAndVersion( ctx context.Context, path string, version uint, ) (*secretsDomain.Secret, error)
GetByPathAndVersion retrieves a specific version of a secret by its path and version number.
type PostgreSQLSecretRepository ¶
type PostgreSQLSecretRepository struct {
// contains filtered or unexported fields
}
PostgreSQLSecretRepository implements Secret persistence for PostgreSQL databases.
func NewPostgreSQLSecretRepository ¶
func NewPostgreSQLSecretRepository(db *sql.DB) *PostgreSQLSecretRepository
NewPostgreSQLSecretRepository creates a new PostgreSQL Secret repository instance.
func (*PostgreSQLSecretRepository) Create ¶
func (p *PostgreSQLSecretRepository) Create(ctx context.Context, secret *secretsDomain.Secret) error
Create inserts a new secret into the PostgreSQL database.
func (*PostgreSQLSecretRepository) Delete ¶
Delete performs a soft delete on a secret by setting the DeletedAt timestamp.
func (*PostgreSQLSecretRepository) GetByPath ¶
func (p *PostgreSQLSecretRepository) GetByPath( ctx context.Context, path string, ) (*secretsDomain.Secret, error)
GetByPath retrieves the latest non-deleted version of a secret by its path.
func (*PostgreSQLSecretRepository) GetByPathAndVersion ¶
func (p *PostgreSQLSecretRepository) GetByPathAndVersion( ctx context.Context, path string, version uint, ) (*secretsDomain.Secret, error)
GetByPathAndVersion retrieves a specific version of a secret by its path and version number.