A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 8ede8bee0cca065e9d48e7a3ebc01aad4e041d3d 61 lines 2.2 kB view raw
1package database 2 3import "time" 4 5// User represents a user in the system 6type User struct { 7 ID int `json:"id"` 8 GithubID int `json:"github_id"` 9 Username string `json:"username"` 10 Email string `json:"email"` 11 AvatarURL string `json:"avatar_url"` 12 CreatedAt time.Time `json:"created_at"` 13 UpdatedAt time.Time `json:"updated_at"` 14 LastRepo string `json:"last_repo"` 15} 16 17// UserRepo represents a repository associated with a user 18type UserRepo struct { 19 ID int `json:"id"` 20 UserID int `json:"user_id"` 21 RepoName string `json:"repo_name"` 22 RepoLink string `json:"repo_link"` 23 LastUsedAt time.Time `json:"last_used_at"` 24 CreatedAt time.Time `json:"created_at"` 25 UpdatedAt time.Time `json:"updated_at"` 26} 27 28// AuthToken represents an OAuth token for a provider 29type AuthToken struct { 30 ID int `json:"id"` 31 UserID int `json:"user_id"` 32 Provider string `json:"provider"` 33 AccessToken string `json:"-"` // Never expose in JSON 34 RefreshToken string `json:"-"` // Never expose in JSON 35 ExpiresAt time.Time `json:"expires_at"` 36 CreatedAt time.Time `json:"created_at"` 37} 38 39// BranchState tracks the state of a user's branch for a repository 40type BranchState struct { 41 ID int `json:"id"` 42 UserID int `json:"user_id"` 43 RepoFullName string `json:"repo_full_name"` 44 BranchName string `json:"branch_name"` 45 BaseBranch string `json:"base_branch"` 46 LastPushAt time.Time `json:"last_push_at"` 47 HasUncommittedChanges bool `json:"has_uncommitted_changes"` 48 FilePaths string `json:"file_paths"` // JSON array 49 CreatedAt time.Time `json:"created_at"` 50 UpdatedAt time.Time `json:"updated_at"` 51} 52 53// DraftContent represents auto-saved content 54type DraftContent struct { 55 ID int `json:"id"` 56 UserID int `json:"user_id"` 57 RepoFullName string `json:"repo_full_name"` 58 FilePath string `json:"file_path"` 59 Content string `json:"content"` 60 LastSavedAt time.Time `json:"last_saved_at"` 61}