-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
26 lines (23 loc) · 752 Bytes
/
config.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
package main
type Configuration struct {
Port int `json:"port"`
User string `json:"user"`
Group string `json:"group"`
Repositories []RepositoryConfig `json:"repositories"`
}
type RepositoryConfig struct {
Url string `json:"url"`
Path string `json:"path"`
Branch string `json:"branch"`
PreCommands []string `json:"precommands"`
PostCommands []string `json:"postcommands"`
}
func (config *Configuration) FindRepositoryConfig(repository Repository) (repoConfig *RepositoryConfig) {
for i := 0; i < len(config.Repositories); i++ {
if config.Repositories[i].Url == repository.Url {
repoConfig = &config.Repositories[i]
return
}
}
return
}