feat: add config and credential storage

This commit is contained in:
2026-05-13 16:17:30 +08:00
parent cb01999a77
commit 187c14122e
5 changed files with 254 additions and 0 deletions

48
internal/domain/types.go Normal file
View File

@@ -0,0 +1,48 @@
package domain
type Config struct {
Gitea GiteaConfig `json:"gitea"`
Update UpdateConfig `json:"update"`
}
type GiteaConfig struct {
BaseURL string `json:"baseURL"`
Org string `json:"org"`
AuthType string `json:"authType"`
Username string `json:"username"`
CredentialKey string `json:"credentialKey"`
}
type UpdateConfig struct {
AutoUpdate bool `json:"autoUpdate"`
CheckOnStartup bool `json:"checkOnStartup"`
IntervalMinutes int `json:"intervalMinutes"`
}
type SaveConfigRequest struct {
Config Config `json:"config"`
Password string `json:"password"`
Token string `json:"token"`
}
type SkillState struct {
Org string `json:"org"`
Repo string `json:"repo"`
LocalPath string `json:"localPath"`
RemoteURL string `json:"remoteURL"`
DefaultBranch string `json:"defaultBranch"`
CurrentCommit string `json:"currentCommit"`
LastCheckedAt string `json:"lastCheckedAt"`
LastError string `json:"lastError"`
InstalledTargets map[string]InstalledTarget `json:"installedTargets"`
}
type InstalledTarget struct {
Path string `json:"path"`
LinkType string `json:"linkType"`
TargetPath string `json:"targetPath"`
}
type State struct {
Skills []SkillState `json:"skills"`
}