Skip to content

Commit 86481c6

Browse files
authored
Update dependencies and remove discontinued providers (#416)
- Update go.mod dependencies (Go 1.23, gophercloud v2, Azure SDK v6) - Migrate Scaleway SDK from account/v2alpha1 to iam/v1alpha1 - Migrate OpenStack gophercloud from v1 to v2 (context.Context required) - Remove Equinix Metal provider (service sunset June 2026) - Remove IONOS Cloud provider (B2B/commercial only) - Add CLAUDE.md for Claude Code guidance Signed-off-by: Engin Diri <engin.diri@ediri.de>
1 parent 49d6c0e commit 86481c6

File tree

10 files changed

+417
-872
lines changed

10 files changed

+417
-872
lines changed

CLAUDE.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Build and Test Commands
6+
7+
```bash
8+
# Build all packages
9+
go build ./...
10+
11+
# Run tests
12+
go test ./...
13+
14+
# Run a single test
15+
go test -run TestName ./package/...
16+
17+
# Tidy dependencies
18+
go mod tidy
19+
20+
# Run linter (requires golangci-lint installed)
21+
golangci-lint run
22+
```
23+
24+
## Linting Configuration
25+
26+
The project uses golangci-lint with settings in `.golangci.yaml`:
27+
- JSON tags use snake_case, YAML tags use camelCase (`tagliatelle` linter)
28+
- `ioutil.*` functions are forbidden - use `os` and `io` packages instead
29+
- Enabled linters include: `gofumpt`, `gocritic`, `gosec`, `errcheck`, `govet`
30+
31+
## Architecture Overview
32+
33+
This is a Go SDK for managing Minecraft servers across multiple cloud providers. The SDK follows a provider-agnostic pattern where each cloud provider implements a common interface.
34+
35+
### Core Interfaces
36+
37+
**`automation.Automation`** (`automation/automation.go`) - The central interface all cloud providers must implement:
38+
- `CreateServer`, `DeleteServer`, `ListServer`, `UpdateServer`, `GetServer`, `UploadPlugin`
39+
40+
**`model.MinecraftResource`** (`model/model.go`) - The configuration model representing a Minecraft server specification with getters for server config, Minecraft edition, SSH settings, etc.
41+
42+
### Package Structure
43+
44+
- **`cloud/`** - Cloud provider implementations. Each subdirectory (akamai, aws, azure, civo, do, exoscale, fuga, gce, hetzner, multipass, oci, openstack, ovh, scaleway, vexxhost, vultr) contains a provider implementing `automation.Automation`
45+
- **`automation/`** - Interface definitions and shared types (`ServerArgs`, `ResourceResults`)
46+
- **`model/`** - Data models for Minecraft resource configuration (server spec, SSH, Java settings, etc.)
47+
- **`template/`** - Go templates for cloud-init and bash scripts used during server provisioning. Templates are embedded via `//go:embed`
48+
- **`update/`** - Remote server operations via SSH (update server, transfer files, execute commands)
49+
- **`common/`** - Shared utilities
50+
51+
### Adding a New Cloud Provider
52+
53+
1. Create a new directory under `cloud/` with your provider name
54+
2. Implement the `automation.Automation` interface
55+
3. Add provider mapping in `cloud/cloud.go`
56+
4. Add provider constant in `model/model.go`
57+
58+
### Key Dependencies
59+
60+
- Cloud SDKs: Each provider uses its native SDK (e.g., `aws-sdk-go-v2`, `azure-sdk-for-go`, `gophercloud/v2`, `scaleway-sdk-go`)
61+
- SSH: `github.com/melbahja/goph` for remote command execution
62+
- Templates: `github.com/Masterminds/sprig/v3` for template functions
63+
64+
## Commit Requirements
65+
66+
Sign-off commits with `git commit -s` for DCO compliance.

cloud/azure/azure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1212
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
13-
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
14-
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v5"
13+
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
14+
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
1515
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
1616
"github.com/dirien/minectl-sdk/automation"
1717
"github.com/dirien/minectl-sdk/cloud"

cloud/cloud.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ var cloudProvider = map[string]string{
1717
"hetzner": "Hetzner",
1818
"akamai": "Akamai Connected Cloud",
1919
"ovh": "OVHcloud",
20-
"equinix": "Equinix Metal",
2120
"gce": "Google Compute Engine",
2221
"vultr": "vultr",
2322
"azure": "Azure",
2423
"oci": "Oracle Cloud Infrastructure",
25-
"ionos": "IONOS Cloud",
2624
"aws": "Amazon Web Services",
2725
"vexxhost": "VEXXHOST",
2826
"exoscale": "Exoscale",

cloud/equinix/equinix.go

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)