gitfetcher

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package gitfetcher creates local mirrors from remote git repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(fp string) (*configpb.Config, error)

ParseConfig returns a parsed configuration from a given path. The path may either point to a configuration file or a folder, in which case the default configuration file name will be used.

func Sync added in v0.3.0

func Sync(ctx context.Context, root string, srcs []*Source) error

Sync syncs local copies in the root folder of each source. Missing local repositories will be created, others will be updated as needed.

Types

type Source added in v0.1.0

type Source struct {
	Name, FetchURL, Description string

	LastUpdatedAt time.Time
	// contains filtered or unexported fields
}

Source captures information about a repository to be mirrored.

func FindSources added in v0.1.0

func FindSources(ctx context.Context, cfg *configpb.Config) ([]*Source, error)

FindSources returns all sources for the provided configuration.

type SyncStatus added in v0.3.0

type SyncStatus int
const (
	SyncStatusAbsent SyncStatus = iota
	SyncStatusStale
	SyncStatusFresh
)

func GetSyncStatus added in v0.3.0

func GetSyncStatus(root string, src *Source) SyncStatus

GetSyncStatus returns the current SyncStatus of a source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL