Documentation
¶
Overview ¶
Package repository provides data access layer for quad-ops units.
Index ¶
- type Repository
- type SystemdRepository
- func (r *SystemdRepository) Create(unit *Unit) (int64, error)
- func (r *SystemdRepository) Delete(_ int64) error
- func (r *SystemdRepository) FindAll() ([]Unit, error)
- func (r *SystemdRepository) FindByID(id int64) (Unit, error)
- func (r *SystemdRepository) FindByUnitType(unitType string) ([]Unit, error)
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface {
FindAll() ([]Unit, error)
FindByUnitType(unitType string) ([]Unit, error)
FindByID(id int64) (Unit, error)
Create(unit *Unit) (int64, error)
Delete(id int64) error
}
Repository defines the interface for unit data access operations.
func NewRepository ¶
func NewRepository() Repository
NewRepository creates a new systemd-based unit repository.
type SystemdRepository ¶ added in v0.19.0
type SystemdRepository struct {
// contains filtered or unexported fields
}
SystemdRepository implements Repository interface by querying systemd directly.
func (*SystemdRepository) Create ¶ added in v0.19.0
func (r *SystemdRepository) Create(unit *Unit) (int64, error)
Create creates or updates unit information (systemd-based approach doesn't store data).
func (*SystemdRepository) Delete ¶ added in v0.19.0
func (r *SystemdRepository) Delete(_ int64) error
Delete removes unit information (systemd-based approach doesn't store data).
func (*SystemdRepository) FindAll ¶ added in v0.19.0
func (r *SystemdRepository) FindAll() ([]Unit, error)
FindAll retrieves all quad-ops managed units by scanning systemd and the filesystem.
func (*SystemdRepository) FindByID ¶ added in v0.19.0
func (r *SystemdRepository) FindByID(id int64) (Unit, error)
FindByID retrieves a single unit by ID (name for systemd-based approach).
func (*SystemdRepository) FindByUnitType ¶ added in v0.19.0
func (r *SystemdRepository) FindByUnitType(unitType string) ([]Unit, error)
FindByUnitType retrieves units filtered by type.