iter

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach(iter UpstreamIter, fn ForEachFunc) error

Types

type CheckoutPuller

type CheckoutPuller struct {
	Wt   *git.Worktree
	Opts options.UpstreamOptions
}

func (*CheckoutPuller) GetOptions

func (p *CheckoutPuller) GetOptions() options.UpstreamOptions

func (*CheckoutPuller) IsWithinPackage

func (p *CheckoutPuller) IsWithinPackage() bool

func (*CheckoutPuller) Pull

func (p *CheckoutPuller) Pull(rootFs billy.Filesystem, fs billy.Filesystem, path string) error

Pull checks out the commit from upstream options and copies the files to the destination.

Because this method mutatues the filesystem, it is not safe to call concurrently.

type ForEachFunc

type ForEachFunc func(p puller.Puller) error

type GitIter

type GitIter struct {
	// UpstreamOptions are the options for the current package.
	UpstreamOptions options.UpstreamOptions
	Delta           UpstreamDelta
	// contains filtered or unexported fields
}

func NewGitIter

func NewGitIter(opts options.UpstreamOptions, delta UpstreamDelta) (*GitIter, error)

func (*GitIter) Next

func (i *GitIter) Next() (puller.Puller, error)

type SingleIter

type SingleIter struct {
	Upstream puller.Puller
}

func (*SingleIter) Next

func (i *SingleIter) Next() (puller.Puller, error)

type UpstreamDelta

type UpstreamDelta options.UpstreamOptions

UpstreamDelta showing the changes to make when creating the next upstreams in an iterator.

func (*UpstreamDelta) Apply

type UpstreamIter

type UpstreamIter interface {
	// Next returns the next puller in the iterator and points the head at the next item. If empty returns io.EOF.
	Next() (puller.Puller, error)
}

func IterForUpstream

func IterForUpstream(upstream puller.Puller, delta UpstreamDelta) (UpstreamIter, error)

func NewSingleIter

func NewSingleIter(upstream puller.Puller, delta UpstreamDelta) (UpstreamIter, error)

Jump to

Keyboard shortcuts

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