collect

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package collect provides functionality to collect file paths for processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPathCollector

type IPathCollector interface {
	CollectPaths(done <-chan struct{}) <-chan *PathResult
}

IPathCollector provides an interface for PathCollector's exported methods.

type PathCollector

type PathCollector struct {
	BaseDir      string
	DefaultPaths []string
	ManualPaths  []string
	Globs        []string
	Recursive    bool
}

PathCollector gathers Dockerfile and docker-compose file paths.

func NewPathCollector

func NewPathCollector(
	baseDir string,
	defaultPaths []string,
	manualPaths []string,
	globs []string,
	recursive bool,
) (*PathCollector, error)

NewPathCollector returns a PathCollector after validating its fields.

func (*PathCollector) CollectPaths

func (p *PathCollector) CollectPaths(done <-chan struct{}) <-chan *PathResult

CollectPaths gathers file paths specified by PathCollector. It removes duplicates and ensures that the file paths are within a subdirectory of the base directory.

type PathResult

type PathResult struct {
	Path string
	Err  error
}

PathResult holds collected paths and errors that occurred while gathering them.

Jump to

Keyboard shortcuts

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