Files
Control-Center/go-backend/internal/repository/interfaces.go

39 lines
1.4 KiB
Go
Raw Normal View History

package repository
import (
"context"
"code.cubecraftcreations.com/CubeCraft-Creations/Control-Center/go-backend/internal/models"
)
// AgentRepo is the interface for agent persistence operations.
type AgentRepo interface {
Create(ctx context.Context, a models.AgentCardData) error
Get(ctx context.Context, id string) (models.AgentCardData, error)
List(ctx context.Context, statusFilter models.AgentStatus) ([]models.AgentCardData, error)
Update(ctx context.Context, id string, req models.UpdateAgentRequest) (models.AgentCardData, error)
Delete(ctx context.Context, id string) error
Count(ctx context.Context) (int, error)
}
// SessionRepo is the interface for session persistence operations.
type SessionRepo interface {
Create(ctx context.Context, s models.Session) (models.Session, error)
ListActive(ctx context.Context) ([]models.Session, error)
Count(ctx context.Context) (int, error)
}
// TaskRepo is the interface for task persistence operations.
type TaskRepo interface {
Create(ctx context.Context, t models.Task) (models.Task, error)
ListRecent(ctx context.Context) ([]models.Task, error)
Count(ctx context.Context) (int, error)
}
// ProjectRepo is the interface for project persistence operations.
type ProjectRepo interface {
Create(ctx context.Context, p models.Project) (models.Project, error)
List(ctx context.Context) ([]models.Project, error)
Count(ctx context.Context) (int, error)
}