dockertest: github.com/ory/dockertest/docker/pkg/fileutils Index | Files

package fileutils

import "github.com/ory/dockertest/docker/pkg/fileutils"

Index

Package Files

fileutils.go fileutils_unix.go

func CopyFile Uses

func CopyFile(src, dst string) (int64, error)

CopyFile copies from src to dst until either EOF is reached on src or an error occurs. It verifies src exists and removes the dst if it exists.

func CreateIfNotExists Uses

func CreateIfNotExists(path string, isDir bool) error

CreateIfNotExists creates a file or a directory only if it does not already exist.

func GetTotalUsedFds Uses

func GetTotalUsedFds() int

GetTotalUsedFds Returns the number of used File Descriptors by reading it via /proc filesystem.

func Matches Uses

func Matches(file string, patterns []string) (bool, error)

Matches returns true if file matches any of the patterns and isn't excluded by any of the subsequent patterns.

func ReadSymlinkedDirectory Uses

func ReadSymlinkedDirectory(path string) (string, error)

ReadSymlinkedDirectory returns the target directory of a symlink. The target of the symbolic link may not be a file.

type Pattern Uses

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

Pattern defines a single regexp used used to filter file paths.

func (*Pattern) Exclusion Uses

func (p *Pattern) Exclusion() bool

Exclusion returns true if this pattern defines exclusion

func (*Pattern) String Uses

func (p *Pattern) String() string

type PatternMatcher Uses

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

PatternMatcher allows checking paths agaist a list of patterns

func NewPatternMatcher Uses

func NewPatternMatcher(patterns []string) (*PatternMatcher, error)

NewPatternMatcher creates a new matcher object for specific patterns that can be used later to match against patterns against paths

func (*PatternMatcher) Exclusions Uses

func (pm *PatternMatcher) Exclusions() bool

Exclusions returns true if any of the patterns define exclusions

func (*PatternMatcher) Matches Uses

func (pm *PatternMatcher) Matches(file string) (bool, error)

Matches matches path against all the patterns. Matches is not safe to be called concurrently

func (*PatternMatcher) Patterns Uses

func (pm *PatternMatcher) Patterns() []*Pattern

Patterns returns array of active patterns

Package fileutils imports 10 packages (graph) and is imported by 5 packages. Updated 2018-04-11. Refresh now. Tools for package owners.