repo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateName = errors.New("duplicate repository name")

Functions

func Sync

func Sync(ctx context.Context, clones *ClonedSet, r Remote) error

Types

type ClonedSet

type ClonedSet struct {
	// contains filtered or unexported fields
}

func CloneAll

func CloneAll(ctx context.Context, set *Set, dir string) (*ClonedSet, error)

func NewClonedSet

func NewClonedSet(dir string) *ClonedSet

func SyncAll

func SyncAll(ctx context.Context, set *Set, dir string) (*ClonedSet, error)

func (*ClonedSet) Clear

func (set *ClonedSet) Clear() error

func (*ClonedSet) Clone

func (set *ClonedSet) Clone(ctx context.Context, r Remote) error

func (*ClonedSet) Dir

func (set *ClonedSet) Dir() string

func (*ClonedSet) Each

func (set *ClonedSet) Each(f func(Local))

func (*ClonedSet) EachTry

func (set *ClonedSet) EachTry(f func(Local) error) error

func (*ClonedSet) Size

func (set *ClonedSet) Size() int

type Local

type Local struct {
	Remote
	Path string
}

func (Local) Checkout

func (l Local) Checkout(ctx context.Context, ref string) error

func (Local) CheckoutFirst

func (l Local) CheckoutFirst(ctx context.Context, ref string, otherRefs ...string) error

func (Local) Command

func (l Local) Command(ctx context.Context, cmdName string, args ...string) *exec.Cmd

func (Local) CurrentHash

func (l Local) CurrentHash(ctx context.Context) (string, error)

func (Local) Fetch

func (l Local) Fetch(ctx context.Context) error

func (Local) Reset

func (l Local) Reset(ctx context.Context) error

func (Local) Run

func (l Local) Run(ctx context.Context, cmdName string, args ...string) error

type Remote

type Remote struct {
	Name string
	URL  string
	// contains filtered or unexported fields
}

func (Remote) Clone

func (r Remote) Clone(ctx context.Context, dir string) (Local, error)

func (Remote) Command

func (r Remote) Command(ctx context.Context, cmdName string, args ...string) *exec.Cmd

func (Remote) Log

func (r Remote) Log() *log.Logger

func (Remote) Out

func (r Remote) Out() io.Writer

type Set

type Set struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet() *Set

func (*Set) Add

func (set *Set) Add(ri Remote) error

func (*Set) Copy

func (set *Set) Copy() *Set

func (*Set) Each

func (set *Set) Each(f func(Remote))

func (*Set) EachTry

func (set *Set) EachTry(f func(Remote) error) error

func (*Set) Size

func (set *Set) Size() int

Jump to

Keyboard shortcuts

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