sync

package
v0.0.0-...-6db64f3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusError = iota
	StatusCloned
	StatusFetched
	StatusUpToDate
	StatusUnmanaged
)
View Source
const (
	SymbolError     = "\u001b[31m✗  \u001b[0m" //red
	SymbolClone     = "\u001b[36m+  \u001b[0m" //cyan
	SymbolFetch     = "\u001b[33m↓  \u001b[0m" //yellow
	SymbolUpToDate  = "\u001b[32m✓  \u001b[0m" //green
	SymbolUnmanaged = "\u001b[33m!  \u001b[0m"
)

Variables

This section is empty.

Functions

func GitSyncHelper

func GitSyncHelper(g concurrency.Project) interface{}

func ShouldBeVerbose

func ShouldBeVerbose(isTerminal, verbose, debug bool) bool

func Unmanaged

func Unmanaged(dirs []string, managedDirs []string) []string

Types

type Git

type Git interface {
	GetLocation() string
	PlainOpen() (*git.Repository, error)
	PlainClone() (string, error)
	Fetch(*git.Repository) (string, error)
	Pull(*git.Worktree) (string, error)
}

Git interface for network operations

type GitSyncProject

type GitSyncProject struct {
	concurrency.Project
}

func (GitSyncProject) Fetch

func (p GitSyncProject) Fetch(repo *git.Repository) (string, error)

func (GitSyncProject) GetLocation

func (p GitSyncProject) GetLocation() string

func (GitSyncProject) PlainClone

func (p GitSyncProject) PlainClone() (string, error)

func (GitSyncProject) PlainOpen

func (p GitSyncProject) PlainOpen() (*git.Repository, error)

func (GitSyncProject) Pull

func (p GitSyncProject) Pull(worktree *git.Worktree) (string, error)

type Status

type Status struct {
	Path   string
	Status int
	Output string
	Err    error
}

func GitSync

func GitSync(g Git) Status

type UI

type UI struct {
	StatusChan chan Status
	// contains filtered or unexported fields
}

func NewUI

func NewUI(isTerminal, verbose, debug bool) UI

func (*UI) MakeUI

func (ui *UI) MakeUI(done bool) string

func (*UI) Run

func (ui *UI) Run()

func (*UI) UpdateUI

func (ui *UI) UpdateUI(status Status)

Jump to

Keyboard shortcuts

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