file_reader

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const GiterminismConfigName = "werf-giterminism.yaml"

Variables

View Source
var DefaultWerfConfigNames = []string{"werf.yaml", "werf.yml"}
View Source
var DefaultWerfConfigTemplatesDirName = ".werf"

Functions

func IsFileNotFoundInProjectDirectoryError

func IsFileNotFoundInProjectDirectoryError(err error) bool

Types

type FileNotAcceptedError

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

type FileNotFoundInProjectDirectoryError

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

type FileNotFoundInProjectRepositoryError

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

type FileReader

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

func NewFileReader

func NewFileReader(sharedOptions sharedOptions) FileReader

func (FileReader) CheckCommitFileExistenceAndLocalChanges

func (r FileReader) CheckCommitFileExistenceAndLocalChanges(ctx context.Context, relPath string) (err error)

CheckCommitFileExistenceAndLocalChanges returns nil if the file exists and does not have any uncommitted changes locally (each symlink target).

func (FileReader) CheckConfigurationFileExistenceAndAcceptance

func (r FileReader) CheckConfigurationFileExistenceAndAcceptance(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (err error)

CheckConfigurationFileExistenceAndAcceptance does CheckFileExistenceAndAcceptance or CheckCommitFileExistenceAndLocalChanges depending on the giterminism config.

func (FileReader) CheckFileExistenceAndAcceptance

func (r FileReader) CheckFileExistenceAndAcceptance(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (err error)

CheckFileExistenceAndAcceptance returns nil if the resolved file exists and is fully accepted by the giterminism config (each symlink target must be accepted if the file path accepted)

func (FileReader) ConfigGoTemplateFilesGet

func (r FileReader) ConfigGoTemplateFilesGet(ctx context.Context, relPath string) ([]byte, error)

func (FileReader) ConfigGoTemplateFilesGlob

func (r FileReader) ConfigGoTemplateFilesGlob(ctx context.Context, glob string) (map[string]interface{}, error)

func (FileReader) ExtraWindowsCheckFileModifiedLocally

func (r FileReader) ExtraWindowsCheckFileModifiedLocally(ctx context.Context, relPath string) error

https://github.com/go-git/go-git/issues/227

func (FileReader) ExtraWindowsCheckFilesModifiedLocally

func (r FileReader) ExtraWindowsCheckFilesModifiedLocally(ctx context.Context, relPathList ...string) error

https://github.com/go-git/go-git/issues/227

func (FileReader) HandleValidateSubmodulesErr added in v1.2.6

func (r FileReader) HandleValidateSubmodulesErr(err error) error

func (FileReader) IsCommitFileExist

func (r FileReader) IsCommitFileExist(ctx context.Context, relPath string) (bool, error)

func (FileReader) IsCommitFileModifiedLocally

func (r FileReader) IsCommitFileModifiedLocally(ctx context.Context, relPath string) (modified bool, err error)

func (FileReader) IsCommitTreeEntryExist

func (r FileReader) IsCommitTreeEntryExist(ctx context.Context, relPath string) (bool, error)

func (FileReader) IsConfigExistAnywhere

func (r FileReader) IsConfigExistAnywhere(ctx context.Context, customRelPath string) (exist bool, err error)

func (FileReader) IsConfigurationFileExist

func (r FileReader) IsConfigurationFileExist(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (exist bool, err error)

IsConfigurationFileExist checks the configuration file existence taking into account the giterminism config. The method does not check acceptance for each symlink target if the configuration file is symlink.

func (FileReader) IsConfigurationFileExistAnywhere

func (r FileReader) IsConfigurationFileExistAnywhere(ctx context.Context, relPath string) (exist bool, err error)

IsConfigurationFileExistAnywhere returns true if the configuration file exists in the project directory or in the project repository.

func (FileReader) IsDirectoryExist

func (r FileReader) IsDirectoryExist(ctx context.Context, relPath string) (exist bool, err error)

IsDirectoryExist resolves symlinks and returns true if the resolved file is a directory.

func (FileReader) IsDockerignoreExistAnywhere

func (r FileReader) IsDockerignoreExistAnywhere(ctx context.Context, relPath string) (exist bool, err error)

func (FileReader) IsGiterminismConfigExistAnywhere

func (r FileReader) IsGiterminismConfigExistAnywhere(ctx context.Context) (exist bool, err error)

func (FileReader) IsRegularFileExist

func (r FileReader) IsRegularFileExist(ctx context.Context, relPath string) (exist bool, err error)

IsRegularFileExist resolves symlinks and returns true if the resolved file is a regular file.

func (FileReader) ListCommitFilesWithGlob

func (r FileReader) ListCommitFilesWithGlob(ctx context.Context, dir string, pattern string) (files []string, err error)

func (FileReader) ListFilesWithGlob

func (r FileReader) ListFilesWithGlob(ctx context.Context, relDir, glob string) (files []string, err error)

ListFilesWithGlob returns the list of files by the glob, follows symlinks. The result paths are relative to the passed directory, the method does reverse resolving for symlinks.

func (FileReader) LoadChartDir

func (r FileReader) LoadChartDir(ctx context.Context, chartDir string) ([]*chart.ChartExtenderBufferedFile, error)

func (FileReader) LocateChart

func (r FileReader) LocateChart(ctx context.Context, chartDir string, settings *cli.EnvSettings) (string, error)

func (FileReader) NewFileNotFoundInProjectDirectoryError

func (r FileReader) NewFileNotFoundInProjectDirectoryError(relPath string) error

func (FileReader) NewFileNotFoundInProjectRepositoryError

func (r FileReader) NewFileNotFoundInProjectRepositoryError(relPath string) error

func (FileReader) NewUncleanSubmoduleError

func (r FileReader) NewUncleanSubmoduleError(submodulePath, headCommit, currentCommit, expectedCommit string) error

func (FileReader) NewUncommittedFilesError

func (r FileReader) NewUncommittedFilesError(relPaths ...string) error

func (FileReader) NewUncommittedSubmoduleChangesError

func (r FileReader) NewUncommittedSubmoduleChangesError(submodulePath string, filePathList []string) error

func (FileReader) PrepareConfigNotFoundError

func (r FileReader) PrepareConfigNotFoundError(ctx context.Context, configPathsToCheck []string) (err error)

func (FileReader) ReadAndCheckConfigurationFile

func (r FileReader) ReadAndCheckConfigurationFile(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (data []byte, err error)

ReadAndCheckConfigurationFile does CheckConfigurationFileExistenceAndAcceptance and ReadConfigurationFile.

func (FileReader) ReadChartFile

func (r FileReader) ReadChartFile(ctx context.Context, path string) ([]byte, error)

func (FileReader) ReadCommitFile

func (r FileReader) ReadCommitFile(ctx context.Context, relPath string) ([]byte, error)

func (FileReader) ReadCommitTreeEntryContent

func (r FileReader) ReadCommitTreeEntryContent(ctx context.Context, relPath string) ([]byte, error)

func (FileReader) ReadConfig

func (r FileReader) ReadConfig(ctx context.Context, customRelPath string) (data []byte, err error)

func (FileReader) ReadConfigTemplateFiles

func (r FileReader) ReadConfigTemplateFiles(ctx context.Context, customDirRelPath string, tmplFunc func(templatePathInsideDir string, data []byte, err error) error) (err error)

func (FileReader) ReadConfigurationFile

func (r FileReader) ReadConfigurationFile(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (data []byte, err error)

ReadConfigurationFile does ReadFile or ReadCommitFile depending on the giterminism config.

func (FileReader) ReadDockerfile

func (r FileReader) ReadDockerfile(ctx context.Context, relPath string) (data []byte, err error)

func (FileReader) ReadDockerignore

func (r FileReader) ReadDockerignore(ctx context.Context, relPath string) (data []byte, err error)

func (FileReader) ReadFile

func (r FileReader) ReadFile(ctx context.Context, relPath string) (data []byte, err error)

ReadFile returns the project file data.

func (FileReader) ReadGiterminismConfig

func (r FileReader) ReadGiterminismConfig(ctx context.Context) (data []byte, err error)

func (FileReader) ResolveAndCheckCommitFilePath

func (r FileReader) ResolveAndCheckCommitFilePath(ctx context.Context, relPath string, checkSymlinkTargetFunc func(resolvedRelPath string) error) (string, error)

func (FileReader) ResolveAndCheckFilePath

func (r FileReader) ResolveAndCheckFilePath(ctx context.Context, relPath string, checkFunc func(resolvedPath string) error) (resolvedPath string, err error)

ResolveAndCheckFilePath resolves the path and run checkFunc for every file path resolve.

func (FileReader) ResolveFilePath

func (r FileReader) ResolveFilePath(ctx context.Context, relPath string) (resolvedPath string, err error)

func (*FileReader) SetGiterminismConfig

func (r *FileReader) SetGiterminismConfig(giterminismConfig giterminismConfig)

func (FileReader) ShouldFileBeRead

func (r FileReader) ShouldFileBeRead(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) (bool, error)) (should bool, err error)

ShouldFileBeRead return true if not resolved path accepted by giterminism config.

func (FileReader) ValidateRelatedSubmodules added in v1.2.6

func (r FileReader) ValidateRelatedSubmodules(ctx context.Context, relPath string) (err error)

func (FileReader) WalkConfigurationFilesWithGlob

func (r FileReader) WalkConfigurationFilesWithGlob(ctx context.Context, dir, glob string, isFileAcceptedCheckFunc func(relPath string) (bool, error), handleFileFunc func(notResolvedPath string, data []byte, err error) error) (err error)

WalkConfigurationFilesWithGlob reads the configuration files taking into account the giterminism config. The result paths are relative to the passed directory, the method does reverse resolving for symlinks.

type UncommittedFilesError

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

Jump to

Keyboard shortcuts

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