chore(images): initialise Docker service with containerd client

This commit is contained in:
Pasha Sviderski
2025-10-02 15:51:54 +10:00
parent 92975eec51
commit 59074a275f
5 changed files with 78 additions and 32 deletions
+10 -4
View File
@@ -12,21 +12,27 @@ import (
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"github.com/jmoiron/sqlx"
"github.com/psviderski/uncloud/internal/containerd"
"github.com/psviderski/uncloud/pkg/api"
)
// Service provides higher-level Docker operations that extends Docker API with Uncloud-specific data
// from the machine database.
type Service struct {
// Client is a Docker client for managing Docker resources.
Client *client.Client
db *sqlx.DB
// containerd is a containerd client for accessing containerd images.
containerd *containerd.Client
// db is a connection to the machine database.
db *sqlx.DB
}
// NewService creates a new Docker service instance.
func NewService(client *client.Client, db *sqlx.DB) *Service {
func NewService(client *client.Client, containerdClient *containerd.Client, db *sqlx.DB) *Service {
return &Service{
Client: client,
db: db,
Client: client,
containerd: containerdClient,
db: db,
}
}