/
repository.go
40 lines (31 loc) · 918 Bytes
/
repository.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package entity
import "github.com/bitwormhole/wpm/server/data/dxo"
// RemoteRepository ...
type RemoteRepository struct {
ID dxo.RemoteRepositoryID `gorm:"primaryKey"`
Base
Name string
URL string
DisplayName string
}
// LocalRepository ...
type LocalRepository struct {
ID dxo.LocalRepositoryID `gorm:"primaryKey"`
Base
// LocalRepositoryBase
Name string
DisplayName string
Description string
Bare bool
ConfigFile string
RepositoryPath string // the parent of ConfigFile
DotGitPath string // can be empty
WorkingPath string // can be empty
Path string // this.Path == Location.Path == ConfigFile
Location dxo.LocationID `gorm:"index:,unique"`
Class dxo.LocationClass
}
// ListPathFields ...
func (LocalRepository) ListPathFields() []string {
return []string{"path", "config_file", "repository_path", "dot_git_path", "working_path"}
}