mengstack-api/internal/app/upgrade/upgrade.go
MengStack Dev df809f1045
Some checks failed
CI / Build & Test (push) Failing after 1m31s
feat: user CRUD API + dashboard stats + kernel infrastructure
- Add user management endpoints (list/create/get/update/delete) with pagination and search
- Add dashboard stats endpoint with tenant/user/online counts and growth metrics
- Add tenant resolver middleware for multi-tenant request scoping
- Add i18n kernel with zh/en message files and AcceptLanguage middleware
- Add WebSocket hub/handler for real-time communication
- Add job scheduler kernel with cron support
- Add plugin sandbox for isolated execution
- Add storage kernel (local filesystem)
- Add event bus kernel for pub/sub
- Add cache kernel abstraction
- Add database migration runner and version upgrade checker
- Add rate limiting middleware with Redis backend
- Add SQL migrations for rbac, audit_logs, settings, notifications, examples
- Extend user repository with list/delete/count operations
- Register all module routes with tenant resolver
2026-10-03 03:42:58 +08:00

33 lines
1.1 KiB
Go

package upgrade
import "time"
// Manifest describes a release version's metadata for upgrade checks.
type Manifest struct {
Version string `json:"version"`
MinVersion string `json:"min_version"`
DownloadURL string `json:"download_url"`
Changelog string `json:"changelog"`
Checksum string `json:"checksum_sha256"`
Size int64 `json:"size"`
PublishedAt time.Time `json:"published_at"`
Critical bool `json:"critical"`
}
// UpgradeStatus represents the result of an upgrade check.
type UpgradeStatus struct {
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
Available bool `json:"available"`
Critical bool `json:"critical"`
Manifest *Manifest `json:"manifest,omitempty"`
CheckedAt time.Time `json:"checked_at"`
}
// Checker defines the upgrade check contract.
// Implementation is deferred to a later phase.
type Checker interface {
// Check queries the update source and returns the current upgrade status.
Check(currentVersion string) (*UpgradeStatus, error)
}