ignore

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ignore defines the implementation of file ignoring patterns that will be used during bundle. It defines an interface FileIgnorer, that should be implemented by all functions that intend to provide file ignore logic. Currently it has two implementations of FileIgnorer:

  • a default ignorer that checks a file or directory for ignorability for all common patterns such as .git, node_modules, vendor etc.,
  • a docker ignorer checks a file or directory for ignorability based on the patterns defined in .dockerignore file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileIgnorer

type FileIgnorer interface {
	// CanIgnore checks file has to be ignored or not, returns true if it needs to be ignored
	CanIgnore(path string, fi os.FileInfo) (Ignorable, error)
}

FileIgnorer helps identifying if a BundleFile needs to be ignored

func NewOrDefault

func NewOrDefault(dir string) (FileIgnorer, error)

NewOrDefault builds and returns the new or default FileIgnorer interface In all file not found cases the this wil return the default ignorer

type Ignorable

type Ignorable int

Ignorable holds the what type of ignore

const (
	// No marks the directory or file not to be ignored
	No Ignorable = iota
	// Transitive marks the directory is transitive ignore so not to be skipped
	Transitive
	// Current marks the directory to be not having any transitive dependencies
	// so clean be skipped from walking
	Current
)

func (Ignorable) String

func (i Ignorable) String() string

String implements fmt.Stringer

Jump to

Keyboard shortcuts

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