Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadToken ¶ added in v0.4.7
ReadToken reads the GitHub token from GITBACK_TOKEN or the layout's token file, and logs which source was used.
GITBACK_TOKEN always takes precedence over the token file.
logger may be nil (some callers, like doctor, may not have a working logger yet) — Emit is nil-safe, so this never panics.
Types ¶
type Config ¶
type Config struct {
GitHub GitHubConfig
Storage StorageConfig
Sync SyncConfig
Snapshot SnapshotConfig
Health HealthConfig
Logging LoggingConfig
}
func Default ¶
Default returns the default configuration, given a resolved Layout so that default mirror/snapshot paths sit alongside GitBack's other data.
func Load ¶
Load reads and validates configuration using the given Layout to locate config.toml. It never falls back to defaults — a missing config file is a hard error, since GitBack shouldn't silently run on unconfigured defaults. Run `gitback init` to create one.
func (Config) GistMirrorRoot ¶ added in v0.5.4
func (Config) QuarantineDir ¶ added in v0.5.4
func (Config) RepositoryMirrorRoot ¶ added in v0.5.4
RepositoryMirrorRoot, GistMirrorRoot, and QuarantineDir are DERIVED from the user-configured MirrorRoot.
type GitHubConfig ¶ added in v0.5.0
type GitHubConfig struct {
BackupGists bool `mapstructure:"backup_gists"`
}
type HealthConfig ¶ added in v0.5.0
type HealthConfig struct {
MinimumFreeDiskPercent uint8 `mapstructure:"minimum_free_disk_percent"`
}
type LoggingConfig ¶ added in v0.5.5
type SnapshotConfig ¶ added in v0.5.0
type StorageConfig ¶ added in v0.5.0
type StorageConfig struct {
MirrorRoot string `mapstructure:"mirror_root"`
}