feat: add config and models packages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
internal/models/models.go
Normal file
42
internal/models/models.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type GiteaServer struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
Token string `json:"-"` // Never expose in JSON
|
||||
SyncInterval int `json:"sync_interval"`
|
||||
LastSyncAt *time.Time `json:"last_sync_at"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type Repo struct {
|
||||
ID int64 `json:"id"`
|
||||
ServerID int64 `json:"server_id"`
|
||||
Name string `json:"name"`
|
||||
FullName string `json:"full_name"`
|
||||
CloneURL string `json:"clone_url"`
|
||||
LocalPath string `json:"local_path"`
|
||||
Size int64 `json:"size"`
|
||||
LastSyncAt *time.Time `json:"last_sync_at"`
|
||||
SyncStatus string `json:"sync_status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type SyncLog struct {
|
||||
ID int64 `json:"id"`
|
||||
ServerID int64 `json:"server_id"`
|
||||
RepoID *int64 `json:"repo_id"`
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
FinishedAt *time.Time `json:"finished_at"`
|
||||
}
|
||||
|
||||
type Setting struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
Reference in New Issue
Block a user