Massive architectural rework

This commit massively overhauls the project's structure to simplify
development. Most parts are now correctly compartmentalized and
dependencies are passed in a sane way rather than global variables
galore xd.
This commit is contained in:
Zoe
2025-05-02 12:15:40 -05:00
parent f4bf2ff5a1
commit c891c24843
50 changed files with 2684 additions and 2410 deletions

29
internal/docker/docker.go Normal file
View File

@@ -0,0 +1,29 @@
package docker
import (
"github.com/docker/docker/client"
"go.uber.org/zap"
)
type DockerID string
// structure that holds the docker daemon information
type DockerClient struct {
client *client.Client
logger *zap.SugaredLogger
}
func NewDocker(rawDockerClient *client.Client, logger *zap.SugaredLogger) *DockerClient {
if rawDockerClient == nil {
var err error
rawDockerClient, err = client.NewClientWithOpts(client.FromEnv)
if err != nil {
logger.Fatalw("Failed to create docker client", zap.Error(err))
}
}
return &DockerClient{
client: rawDockerClient,
logger: logger,
}
}