{"modulePath":"github.com/GoCodeAlone/workflow","version":"v0.87.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package drivers\n\nPackage drivers provides resource driver implementations for the Docker Compose provider. Each driver handles the CRUD lifecycle for a specific Docker Compose resource type.\n\n## Types\n\n```go\ntype ComposeExecutor interface {\n\tPs(ctx context.Context, projectDir string, files ...string) (string, error)\n}\n```\nComposeExecutor is a minimal interface matching the executor methods needed by drivers.\n\n```go\ntype NetworkDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nNetworkDriver handles CRUD operations for Docker Compose networks. It implements platform.ResourceDriver for the \"docker-compose.network\" type.\n\n```go\nfunc NewNetworkDriver(executor ComposeExecutor, projectDir string) *NetworkDriver\n```\nNewNetworkDriver creates a NetworkDriver.\n\n```go\nfunc (d *NetworkDriver) Create(_ context.Context, name string, properties map[string]any) (*platform.ResourceOutput, error)\n```\nCreate provisions a new compose network.\n\n```go\nfunc (d *NetworkDriver) Delete(_ context.Context, _ string) error\n```\nDelete removes a network from the compose definition.\n\n```go\nfunc (d *NetworkDriver) Diff(ctx context.Context, name string, desired map[string]any) ([]platform.DiffEntry, error)\n```\nDiff compares desired properties with current state.\n\n```go\nfunc (d *NetworkDriver) HealthCheck(_ context.Context, name string) (*platform.HealthStatus, error)\n```\nHealthCheck returns the health status of a compose network.\n\n```go\nfunc (d *NetworkDriver) Read(_ context.Context, name string) (*platform.ResourceOutput, error)\n```\nRead fetches the current state of a compose network.\n\n```go\nfunc (d *NetworkDriver) ResourceType() string\n```\nResourceType returns \"docker-compose.network\".\n\n```go\nfunc (d *NetworkDriver) Scale(_ context.Context, _ string, _ map[string]any) (*platform.ResourceOutput, error)\n```\nScale is not supported for networks.\n\n```go\nfunc (d *NetworkDriver) Update(_ context.Context, name string, _, desired map[string]any) (*platform.ResourceOutput, error)\n```\nUpdate modifies a compose network definition.\n\n```go\ntype ServiceDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nServiceDriver handles CRUD operations for Docker Compose services. It implements platform.ResourceDriver for the \"docker-compose.service\" type.\n\n```go\nfunc NewServiceDriver(executor ComposeExecutor, projectDir string) *ServiceDriver\n```\nNewServiceDriver creates a ServiceDriver.\n\n```go\nfunc (d *ServiceDriver) Create(_ context.Context, name string, properties map[string]any) (*platform.ResourceOutput, error)\n```\nCreate provisions a new compose service. In Docker Compose, creation happens when docker compose up is run with the updated compose file. This driver records the desired state and returns a pending resource output.\n\n```go\nfunc (d *ServiceDriver) Delete(_ context.Context, _ string) error\n```\nDelete marks a service for removal. The actual removal happens when docker compose up --remove-orphans is run.\n\n```go\nfunc (d *ServiceDriver) Diff(ctx context.Context, name string, desired map[string]any) ([]platform.DiffEntry, error)\n```\nDiff compares desired properties with current state and returns differences.\n\n```go\nfunc (d *ServiceDriver) HealthCheck(ctx context.Context, name string) (*platform.HealthStatus, error)\n```\nHealthCheck returns the health status of a compose service.\n\n```go\nfunc (d *ServiceDriver) Read(_ context.Context, name string) (*platform.ResourceOutput, error)\n```\nRead fetches the current state of a compose service.\n\n```go\nfunc (d *ServiceDriver) ResourceType() string\n```\nResourceType returns \"docker-compose.service\".\n\n```go\nfunc (d *ServiceDriver) Scale(_ context.Context, name string, scaleParams map[string]any) (*platform.ResourceOutput, error)\n```\nScale adjusts the replica count for a compose service.\n\n```go\nfunc (d *ServiceDriver) Update(_ context.Context, name string, _, desired map[string]any) (*platform.ResourceOutput, error)\n```\nUpdate modifies a compose service by generating a new desired state.\n\n```go\ntype StubDriver struct{}\n```\nStubDriver handles capabilities that Docker Compose cannot faithfully implement (e.g., Kubernetes clusters, IAM roles). It returns resource outputs with stub status and logs warnings to alert users of fidelity gaps.\n\n```go\nfunc NewStubDriver() *StubDriver\n```\nNewStubDriver creates a StubDriver for unsupported capabilities.\n\n```go\nfunc (d *StubDriver) Create(_ context.Context, name string, properties map[string]any) (*platform.ResourceOutput, error)\n```\nCreate logs a warning and returns a stub resource output.\n\n```go\nfunc (d *StubDriver) Delete(_ context.Context, name string) error\n```\nDelete is a no-op for stub resources.\n\n```go\nfunc (d *StubDriver) Diff(_ context.Context, _ string, _ map[string]any) ([]platform.DiffEntry, error)\n```\nDiff always returns no differences for stub resources.\n\n```go\nfunc (d *StubDriver) HealthCheck(_ context.Context, name string) (*platform.HealthStatus, error)\n```\nHealthCheck always returns healthy for stubs since they are no-ops.\n\n```go\nfunc (d *StubDriver) Read(_ context.Context, name string) (*platform.ResourceOutput, error)\n```\nRead returns the stub resource state.\n\n```go\nfunc (d *StubDriver) ResourceType() string\n```\nResourceType returns \"docker-compose.stub\".\n\n```go\nfunc (d *StubDriver) Scale(_ context.Context, _ string, _ map[string]any) (*platform.ResourceOutput, error)\n```\nScale is not supported for stub resources.\n\n```go\nfunc (d *StubDriver) Update(_ context.Context, name string, _, desired map[string]any) (*platform.ResourceOutput, error)\n```\nUpdate logs a warning and returns the stub output unchanged.\n\n```go\ntype VolumeDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nVolumeDriver handles CRUD operations for Docker Compose volumes. It implements platform.ResourceDriver for the \"docker-compose.volume\" type.\n\n```go\nfunc NewVolumeDriver(executor ComposeExecutor, projectDir string) *VolumeDriver\n```\nNewVolumeDriver creates a VolumeDriver.\n\n```go\nfunc (d *VolumeDriver) Create(_ context.Context, name string, properties map[string]any) (*platform.ResourceOutput, error)\n```\nCreate provisions a new compose volume.\n\n```go\nfunc (d *VolumeDriver) Delete(_ context.Context, _ string) error\n```\nDelete removes a volume from the compose definition.\n\n```go\nfunc (d *VolumeDriver) Diff(ctx context.Context, name string, desired map[string]any) ([]platform.DiffEntry, error)\n```\nDiff compares desired properties with current state.\n\n```go\nfunc (d *VolumeDriver) HealthCheck(_ context.Context, name string) (*platform.HealthStatus, error)\n```\nHealthCheck returns the health status of a compose volume.\n\n```go\nfunc (d *VolumeDriver) Read(_ context.Context, name string) (*platform.ResourceOutput, error)\n```\nRead fetches the current state of a compose volume.\n\n```go\nfunc (d *VolumeDriver) ResourceType() string\n```\nResourceType returns \"docker-compose.volume\".\n\n```go\nfunc (d *VolumeDriver) Scale(_ context.Context, _ string, _ map[string]any) (*platform.ResourceOutput, error)\n```\nScale is not supported for volumes.\n\n```go\nfunc (d *VolumeDriver) Update(_ context.Context, name string, _, desired map[string]any) (*platform.ResourceOutput, error)\n```\nUpdate modifies a compose volume definition.\n\n","path":"github.com/GoCodeAlone/workflow/platform/providers/dockercompose/drivers","name":"drivers","synopsis":"Package drivers provides resource driver implementations for the Docker Compose provider.","isRedistributable":true}
