feat: add config and credential storage
This commit is contained in:
48
internal/domain/types.go
Normal file
48
internal/domain/types.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user