Documentation
¶
Overview ¶
Package gitfetcher creates local mirrors from remote git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( FindTargets = target.Find LoadSources = source.Load )
Reexports.
Functions ¶
func FindConfig ¶ added in v0.13.0
FindConfig locates the first configuration file named .gitfetcher.conf starting from dpath and going up the filesystem hierarchy. If no such file is found, a default configuration is returned with root set to dpath.
Types ¶
type Config ¶
Config is the generated configuration type, exported here for use in helper signatures.
type SyncStatus ¶ added in v0.3.0
type SyncStatus int
SyncStatus captures possible states of the local repository vs its remote.
const ( // Not enough information. SyncStatusUnknown SyncStatus = iota // No local copy of the repository. SyncStatusMissing // A local copy of the repository exists but is not up-to-date. SyncStatusStale // The local copy of the repository exists and is up-to-date. SyncStatusFresh )
type Syncable ¶ added in v0.13.0
type Syncable struct { // Absolute local path to the repository's gitdir. GitDir fspath.Local // contains filtered or unexported fields }
Syncable contains all the information needed to mirror a repository.
func GatherSyncables ¶ added in v0.13.0
func GatherSyncables( targets []target.Target, sources []source.Source, root string, initLayout configpb.Options_Layout, ) ([]Syncable, error)
GatherSyncables reconciles targets and sources into Syncable instances.
func (*Syncable) LastSyncedAt ¶ added in v0.13.0
LastSyncedAt returns the time at which the repo's origin remote was last updated, or zero if the repo does not exist locally.
func (*Syncable) RootDir ¶ added in v0.13.0
RootDir returns the syncable's outermost directory (workdir if present, else gitdir).
func (*Syncable) Sync ¶ added in v0.13.0
Sync syncs local copies in the root folder of each source. Missing local repositories will be created, others will be updated as needed.
func (*Syncable) SyncStatus ¶ added in v0.13.0
func (s *Syncable) SyncStatus() SyncStatus
SyncStatus returns the current SyncStatus of the syncable.
Directories
¶
Path | Synopsis |
---|---|
Package fspath enables more explicit type signatures for filesystem paths.
|
Package fspath enables more explicit type signatures for filesystem paths. |
Package target provides a representation of local repositories, i.e.
|
Package target provides a representation of local repositories, i.e. |