Download this file
| 1 | // Package kernel holds shared application values without owning storage. |
| 2 | package kernel |
| 3 | |
| 4 | // Actor is supplied by the verified session, never by a submitted payload. |
| 5 | type Actor struct{ Address string } |
| 6 | |
| 7 | type Mutation struct { |
| 8 | RequestID string |
| 9 | Revision int64 |
| 10 | } |
| 11 | |
| 12 | type ProjectKind string |
| 13 | |
| 14 | const ( |
| 15 | ProjectApp ProjectKind = "app" |
| 16 | ProjectWebsite ProjectKind = "website" |
| 17 | ProjectRepository ProjectKind = "repository" |
| 18 | ) |
| 19 | |
| 20 | type Project struct { |
| 21 | GrantVersion int64 `gorm:"not null;default:1"` |
| 22 | ID int64 |
| 23 | AccountID int64 |
| 24 | Name string |
| 25 | Repository string `gorm:"not null;uniqueIndex:project_binding"` |
| 26 | AppName string `gorm:"not null;uniqueIndex:project_binding"` |
| 27 | DefaultBranch string |
| 28 | Kind ProjectKind |
| 29 | Revision int64 |
| 30 | } |
| 31 | |
| 32 | type Role string |
| 33 | |
| 34 | const ( |
| 35 | RoleOwner Role = "owner" |
| 36 | RoleMember Role = "member" |
| 37 | ) |
| 38 | |
| 39 | type Member struct { |
| 40 | IdentityKey string `gorm:"not null;default:'';uniqueIndex:members_identity_key" json:"-"` |
| 41 | Address string `gorm:"primaryKey"` |
| 42 | Role Role |
| 43 | Revision int64 |
| 44 | Active bool |
| 45 | // SessionEpoch is the earliest permitted session creation time in Unix seconds. |
| 46 | SessionEpoch int64 |
| 47 | } |
| 48 | |
| 49 | type Team struct { |
| 50 | ID string `gorm:"primaryKey"` |
| 51 | Name string |
| 52 | RosterEpoch int64 |
| 53 | } |
| 54 | |