MCPcopy Index your code
hub / github.com/belak/gitdir / NewConfig

Function NewConfig

config.go:35–51  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
35func 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.
54func (c *Config) Load() error {

Callers 6

TestCtxExtractFunction · 0.85
TestCtxConfigFunction · 0.85
EnsureAdminUserMethod · 0.85
ReloadMethod · 0.85
CtxConfigFunction · 0.85
newTestConfigFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestCtxExtractFunction · 0.68
TestCtxConfigFunction · 0.68
newTestConfigFunction · 0.68