MCPcopy Create free account
hub / github.com/amitsaha/gitbackup / fileConfigToAppConfig

Function fileConfigToAppConfig

config_file.go:127–142  ·  view source on GitHub ↗

fileConfigToAppConfig converts a fileConfig into an appConfig. Migration-related fields are left at their zero values since they are CLI-only flags.

(fc *fileConfig)

Source from the content-addressed store, hash-verified

125// Migration-related fields are left at their zero values since they
126// are CLI-only flags.
127func fileConfigToAppConfig(fc *fileConfig) *appConfig {
128 return &appConfig{
129 service: fc.Service,
130 gitHostURL: fc.GitHostURL,
131 backupDir: fc.BackupDir,
132 ignorePrivate: fc.IgnorePrivate,
133 ignoreFork: fc.IgnoreFork,
134 useHTTPSClone: fc.UseHTTPSClone,
135 bare: fc.Bare,
136 githubRepoType: fc.GitHub.RepoType,
137 githubNamespaceWhitelist: fc.GitHub.NamespaceWhitelist,
138 gitlabProjectVisibility: fc.GitLab.ProjectVisibility,
139 gitlabProjectMembershipType: fc.GitLab.ProjectMembershipType,
140 forgejoRepoType: fc.Forgejo.RepoType,
141 }
142}
143
144// loadConfigFile reads and parses the config file at the given path,
145// or at the OS-specific default location if configPath is empty.

Callers 1

buildConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected