internal/models/models.go
1.7 KB
| 1 | package models |
| 2 | |
| 3 | import "time" |
| 4 | |
| 5 | type User struct { |
| 6 | ID int `json:"id"` |
| 7 | Username string `json:"username"` |
| 8 | Email string `json:"email"` |
| 9 | PasswordHash string `json:"-"` |
| 10 | AvatarURL string `json:"avatar_url"` |
| 11 | CreatedAt time.Time `json:"created_at"` |
| 12 | } |
| 13 | |
| 14 | type Repo struct { |
| 15 | ID int `json:"id"` |
| 16 | Name string `json:"name"` |
| 17 | OwnerID int `json:"owner_id"` |
| 18 | Description string `json:"description"` |
| 19 | IsPrivate bool `json:"is_private"` |
| 20 | IsArchived bool `json:"is_archived"` |
| 21 | CloneURL string `json:"clone_url"` |
| 22 | CreatedAt time.Time `json:"created_at"` |
| 23 | UpdatedAt time.Time `json:"updated_at"` |
| 24 | Owner *User `json:"owner,omitempty"` |
| 25 | } |
| 26 | |
| 27 | type Build struct { |
| 28 | ID int `json:"id"` |
| 29 | RepoID int `json:"repo_id"` |
| 30 | Branch string `json:"branch"` |
| 31 | BuildType string `json:"build_type"` |
| 32 | Status string `json:"status"` |
| 33 | LogFile string `json:"log_file"` |
| 34 | StartedAt time.Time `json:"started_at"` |
| 35 | FinishedAt *time.Time `json:"finished_at,omitempty"` |
| 36 | CreatedAt time.Time `json:"created_at"` |
| 37 | } |
| 38 | |
| 39 | type Release struct { |
| 40 | ID int `json:"id"` |
| 41 | RepoID int `json:"repo_id"` |
| 42 | Tag string `json:"tag"` |
| 43 | Title string `json:"title"` |
| 44 | Body string `json:"body"` |
| 45 | IsPrerelease bool `json:"is_prerelease"` |
| 46 | CreatedAt time.Time `json:"created_at"` |
| 47 | } |
| 48 | |
| 49 | type Commit struct { |
| 50 | ID string `json:"id"` |
| 51 | RepoID int `json:"repo_id"` |
| 52 | Branch string `json:"branch"` |
| 53 | Message string `json:"message"` |
| 54 | Author string `json:"author"` |
| 55 | CommittedAt time.Time `json:"committed_at"` |
| 56 | } |