Files
XingfenD 4e467e1136 feat: implement proto-gen platform
- Config loader with env var expansion and validation
- SQLite database with tasks and toolchain_versions tables
- Gitea REST API client for repository and branch operations
- K8s client for Job lifecycle management (with noop fallback for local dev)
- REST API: tasks CRUD, retry, plugins, version management
- Worker/scheduler with polling, concurrency control, and job tracking
- Static frontend: generate, tasks, settings pages
- Toolchain images: Go and Node.js Dockerfiles with entrypoint scripts
- Helm chart with deployment, service, configmap, ingress, PVC
- Multi-stage Dockerfile for service
- Unit tests for config, database, gitclient, k8s, api, worker
- E2E tests for idempotency, version switch, failure recovery
2026-08-10 16:54:30 +08:00

32 lines
584 B
Go

package k8s
type JobStatus string
const (
JobPending JobStatus = "Pending"
JobRunning JobStatus = "Running"
JobSucceeded JobStatus = "Succeeded"
JobFailed JobStatus = "Failed"
)
type JobSpec struct {
Name string
Namespace string
Image string
EnvVars map[string]string
TimeoutSecond int
}
type Job struct {
Name string
Namespace string
Status JobStatus
Logs string
}
type K8sClient interface {
CreateJob(spec *JobSpec) (*Job, error)
GetJob(name, namespace string) (*Job, error)
DeleteJob(name, namespace string) error
}