Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CopyCollector ¶
type CopyCollector struct {
DstDir string // the destination directory to copy to
}
CopyCollector collects files by copying them to a destination directory
type DefaultFs ¶
type DefaultFs struct {
}
DefaultFs provides a default implementation of the [FileCollectorFS] interface
func (*DefaultFs) Open ¶
func (*DefaultFs) Open(path string) (io.ReadCloser, error)
Open opens a path
func (*DefaultFs) OpenGitIndex ¶
OpenGitIndex opens the git index file
type FileCollector ¶
type FileCollector struct {
Ignorer gitignore.Matcher
SrcPath string
SrcPrefix string
Fs FileCollectorFs
Handler FileCollectorHandler
}
FileCollector collects files from a git index
func (*FileCollector) CollectFiles ¶
func (fc *FileCollector) CollectFiles(ctx context.Context, submodulePath []string) filepath.WalkFunc
CollectFiles provides a WalkFunc to collect files in a git index
type FileCollectorFs ¶
type FileCollectorFs interface {
Walk(root string, fn filepath.WalkFunc) error
OpenGitIndex(path string) (*index.Index, error)
Open(path string) (io.ReadCloser, error)
Readlink(path string) (string, error)
}
FileCollectorFs provides an interface for a file system
type FileCollectorHandler ¶
type FileCollectorHandler interface {
WriteFile(path string, fi fs.FileInfo, linkName string, f io.Reader) error
}
FileCollectorHandler provides an interface to collect files
type TarCollector ¶
type TarCollector struct {
TarWriter *tar.Writer // the writer to use for files
UID int // UID to apply to files in the tar
GID int // GID to apply to files in the tar
DstDir string // DstDir is prefixed on files collected before being added to the tar file
}
TarCollector collects files to a tar file
type ZipCollector ¶
ZipCollector is a Collector that writes files to a zip file
Click to show internal directories.
Click to hide internal directories.