repository

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package repository provides data access layer for quad-ops units.

Index

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.

type Unit

type Unit struct {
	ID        int64
	Name      string
	Type      string
	SHA1Hash  []byte
	UpdatedAt time.Time
}

Unit represents a unit managed by quad-ops.

Jump to

Keyboard shortcuts

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