NewConfig returns an empty config, attached to the given fs. In general, Load should be called after creating a new config at a bare minimum.
(fs billy.Filesystem)
| 33 | // NewConfig returns an empty config, attached to the given fs. In general, Load |
| 34 | // should be called after creating a new config at a bare minimum. |
| 35 | func NewConfig(fs billy.Filesystem) *Config { |
| 36 | return &Config{ |
| 37 | Invites: make(map[string]string), |
| 38 | Groups: make(map[string][]string), |
| 39 | Orgs: make(map[string]*models.OrgConfig), |
| 40 | Users: make(map[string]*models.AdminConfigUser), |
| 41 | Repos: make(map[string]*models.RepoConfig), |
| 42 | |
| 43 | orgRepos: make(map[string]string), |
| 44 | userRepos: make(map[string]string), |
| 45 | publicKeys: make(map[string]string), |
| 46 | |
| 47 | Options: models.DefaultAdminConfigOptions, |
| 48 | |
| 49 | fs: fs, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // Load will load the config from the given fs. |
| 54 | func (c *Config) Load() error { |
no outgoing calls