Documentation ¶
Index ¶
- func CreateEmptyLocalGitDirectory(t *testing.T) string
- func CreateLocalGitDirectory(t *testing.T) string
- func CreateLocalGitDirectoryWithSubmodule(t *testing.T) string
- type FakeCallbackInvoker
- type FakeCmdRunner
- func (f *FakeCmdRunner) Run(name string, args ...string) error
- func (f *FakeCmdRunner) RunWithOptions(opts util.CommandOpts, name string, args ...string) error
- func (f *FakeCmdRunner) StartWithStdoutPipe(opts util.CommandOpts, name string, arg ...string) (io.ReadCloser, error)
- func (f *FakeCmdRunner) Wait() error
- type FakeDownloader
- type FakeFileSystem
- func (f *FakeFileSystem) Chmod(file string, mode os.FileMode) error
- func (f *FakeFileSystem) Copy(sourcePath, targetPath string) error
- func (f *FakeFileSystem) CopyContents(sourcePath, targetPath string) error
- func (f *FakeFileSystem) CreateWorkingDirectory() (string, error)
- func (f *FakeFileSystem) Exists(file string) bool
- func (f *FakeFileSystem) Mkdir(dirname string) error
- func (f *FakeFileSystem) MkdirAll(dirname string) error
- func (f *FakeFileSystem) Open(file string) (io.ReadCloser, error)
- func (f *FakeFileSystem) ReadDir(p string) ([]os.FileInfo, error)
- func (f *FakeFileSystem) RemoveDirectory(dir string) error
- func (f *FakeFileSystem) Rename(from, to string) error
- func (f *FakeFileSystem) Stat(p string) (os.FileInfo, error)
- func (f *FakeFileSystem) Walk(root string, walkFn filepath.WalkFunc) error
- func (f *FakeFileSystem) WriteFile(file string, data []byte) error
- type FakeGit
- func (f *FakeGit) Checkout(repo, ref string) error
- func (f *FakeGit) Clone(source, target string, c api.CloneConfig) error
- func (f *FakeGit) GetInfo(repo string) *api.SourceInfo
- func (f *FakeGit) LsTree(repo, ref string, recursive bool) ([]os.FileInfo, error)
- func (f *FakeGit) MungeNoProtocolURL(source string, url *url.URL) error
- func (f *FakeGit) SubmoduleInit(repo string) error
- func (f *FakeGit) SubmoduleUpdate(repo string, init, recursive bool) error
- func (f *FakeGit) ValidCloneSpec(source string) (bool, error)
- func (f *FakeGit) ValidCloneSpecRemoteOnly(source string) bool
- type FakeInstaller
- type FakeReadCloser
- type FakeTar
- func (f *FakeTar) Copy() *FakeTar
- func (f *FakeTar) CreateTarFile(base, dir string) (string, error)
- func (f *FakeTar) CreateTarStream(dir string, includeDirInPath bool, writer io.Writer) error
- func (f *FakeTar) CreateTarStreamReader(dir string, includeDirInPath bool) io.ReadCloser
- func (f *FakeTar) CreateTarStreamToTarWriter(dir string, includeDirInPath bool, writer tar.Writer, logger io.Writer) error
- func (f *FakeTar) ExtractTarStream(dir string, reader io.Reader) error
- func (f *FakeTar) ExtractTarStreamFromTarReader(dir string, tarReader tar.Reader, logger io.Writer) error
- func (f *FakeTar) ExtractTarStreamWithLogging(dir string, reader io.Reader, logger io.Writer) error
- func (f *FakeTar) SetExclusionPattern(*regexp.Regexp)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyLocalGitDirectory ¶ added in v1.1.2
CreateEmptyLocalGitDirectory creates a git directory with no checkin yet
func CreateLocalGitDirectory ¶ added in v1.1.2
CreateLocalGitDirectory creates a git directory with a commit
func CreateLocalGitDirectoryWithSubmodule ¶ added in v1.1.3
CreateLocalGitDirectoryWithSubmodule creates a git directory with a submodule
Types ¶
type FakeCallbackInvoker ¶
type FakeCallbackInvoker struct { CallbackURL string Success bool Messages []string Labels map[string]string Result []string }
FakeCallbackInvoker provides the fake callback invoker
func (*FakeCallbackInvoker) ExecuteCallback ¶
func (f *FakeCallbackInvoker) ExecuteCallback(callbackURL string, success bool, labels map[string]string, messages []string) []string
ExecuteCallback executes the fake callback
type FakeCmdRunner ¶
type FakeCmdRunner struct { Name string Args []string Opts util.CommandOpts Err error }
FakeCmdRunner provider the fake command runner
func (*FakeCmdRunner) Run ¶
func (f *FakeCmdRunner) Run(name string, args ...string) error
Run runs the fake command runner
func (*FakeCmdRunner) RunWithOptions ¶
func (f *FakeCmdRunner) RunWithOptions(opts util.CommandOpts, name string, args ...string) error
RunWithOptions runs the command runner with extra options
func (*FakeCmdRunner) StartWithStdoutPipe ¶ added in v1.1.4
func (f *FakeCmdRunner) StartWithStdoutPipe(opts util.CommandOpts, name string, arg ...string) (io.ReadCloser, error)
StartWithStdoutPipe executes a command returning a ReadCloser connected to the command's stdout.
func (*FakeCmdRunner) Wait ¶ added in v1.1.4
func (f *FakeCmdRunner) Wait() error
Wait waits for the command to exit.
type FakeDownloader ¶
type FakeDownloader struct { URL []url.URL Target []string Err map[string]error // contains filtered or unexported fields }
FakeDownloader provides a fake downloader interface
func (*FakeDownloader) Download ¶
func (f *FakeDownloader) Download(url *url.URL, target string) (*api.SourceInfo, error)
Download downloads a fake file from the URL
type FakeFileSystem ¶
type FakeFileSystem struct { ChmodFile []string ChmodMode os.FileMode ChmodError map[string]error RenameFrom string RenameTo string RenameError error MkdirAllDir []string MkdirAllError error MkdirDir string MkdirError error ExistsFile []string ExistsResult map[string]bool CopySource string CopyDest string CopyError error RemoveDirName string RemoveDirError error WorkingDirCalled bool WorkingDirResult string WorkingDirError error OpenFile string OpenFileResult *FakeReadCloser OpenContent string OpenError error OpenCloseError error WriteFileName string WriteFileError error WriteFileContent string Files []os.FileInfo // contains filtered or unexported fields }
FakeFileSystem provides a fake filesystem structure for testing
func (*FakeFileSystem) Chmod ¶
func (f *FakeFileSystem) Chmod(file string, mode os.FileMode) error
Chmod manipulates permissions on the fake filesystem
func (*FakeFileSystem) Copy ¶
func (f *FakeFileSystem) Copy(sourcePath, targetPath string) error
Copy copies files on the fake filesystem
func (*FakeFileSystem) CopyContents ¶ added in v1.0.4
func (f *FakeFileSystem) CopyContents(sourcePath, targetPath string) error
CopyContents copies directory contents on the fake filesystem
func (*FakeFileSystem) CreateWorkingDirectory ¶
func (f *FakeFileSystem) CreateWorkingDirectory() (string, error)
CreateWorkingDirectory creates a fake working directory
func (*FakeFileSystem) Exists ¶
func (f *FakeFileSystem) Exists(file string) bool
Exists checks if the file exists in fake filesystem
func (*FakeFileSystem) Mkdir ¶
func (f *FakeFileSystem) Mkdir(dirname string) error
Mkdir creates a new directory on the fake filesystem
func (*FakeFileSystem) MkdirAll ¶
func (f *FakeFileSystem) MkdirAll(dirname string) error
MkdirAll creates a new directories on the fake filesystem
func (*FakeFileSystem) Open ¶
func (f *FakeFileSystem) Open(file string) (io.ReadCloser, error)
Open opens a file
func (*FakeFileSystem) ReadDir ¶
func (f *FakeFileSystem) ReadDir(p string) ([]os.FileInfo, error)
ReadDir reads the files in specified directory
func (*FakeFileSystem) RemoveDirectory ¶
func (f *FakeFileSystem) RemoveDirectory(dir string) error
RemoveDirectory removes a directory in the fake filesystem
func (*FakeFileSystem) Rename ¶
func (f *FakeFileSystem) Rename(from, to string) error
Rename renames files on the fake filesystem
func (*FakeFileSystem) Stat ¶
func (f *FakeFileSystem) Stat(p string) (os.FileInfo, error)
Stat provides stats about a single file
type FakeGit ¶
type FakeGit struct { ValidCloneSpecSource string ValidCloneSpecResult bool CloneSource string CloneTarget string CloneError error CheckoutRepo string CheckoutRef string CheckoutError error SubmoduleInitRepo string SubmoduleInitError error SubmoduleUpdateRepo string SubmoduleUpdateInit bool SubmoduleUpdateRecursive bool SubmoduleUpdateError error }
FakeGit provides a fake Git
func (*FakeGit) Clone ¶
func (f *FakeGit) Clone(source, target string, c api.CloneConfig) error
Clone clones the fake source Git repository to target directory
func (*FakeGit) GetInfo ¶ added in v1.0.1
func (f *FakeGit) GetInfo(repo string) *api.SourceInfo
GetInfo retrieves the information about the source code and commit
func (*FakeGit) LsTree ¶ added in v1.1.4
LsTree returns a slice of os.FileInfo objects populated with the paths and file modes of files known to Git. This is used on Windows systems where the executable mode metadata is lost on git checkout.
func (*FakeGit) MungeNoProtocolURL ¶ added in v1.0.4
MungeNoProtocolURL returns a valid no protocol Git URL
func (*FakeGit) SubmoduleInit ¶ added in v1.0.4
SubmoduleInit initializes / clones submodules.
func (*FakeGit) SubmoduleUpdate ¶ added in v1.0.4
SubmoduleUpdate checks out submodules to their correct version
func (*FakeGit) ValidCloneSpec ¶
ValidCloneSpec returns a valid Git clone specification
func (*FakeGit) ValidCloneSpecRemoteOnly ¶ added in v1.0.4
ValidCloneSpecRemoteOnly returns a valid Git clone specification
type FakeInstaller ¶
FakeInstaller provides a fake installer
func (*FakeInstaller) InstallOptional ¶
func (f *FakeInstaller) InstallOptional(scripts []string, dstDir string) []api.InstallResult
InstallOptional downloads and installs optional scripts into dstDir
func (*FakeInstaller) InstallRequired ¶
func (f *FakeInstaller) InstallRequired(scripts []string, dstDir string) ([]api.InstallResult, error)
InstallRequired downloads and installs required scripts into dstDir
type FakeReadCloser ¶
FakeReadCloser provider a fake ReadCloser
func (*FakeReadCloser) Close ¶
func (f *FakeReadCloser) Close() error
Close closes the fake ReadCloser
type FakeTar ¶
type FakeTar struct { CreateTarBase string CreateTarDir string CreateTarResult string CreateTarError error ExtractTarDir string ExtractTarReader io.Reader ExtractTarError error // contains filtered or unexported fields }
FakeTar provides a fake UNIX tar interface
func (*FakeTar) CreateTarFile ¶
CreateTarFile creates a new fake UNIX tar file
func (*FakeTar) CreateTarStream ¶ added in v1.0.3
CreateTarStream creates a tar from the given directory and streams it to the given writer.
func (*FakeTar) CreateTarStreamReader ¶ added in v1.1.4
func (f *FakeTar) CreateTarStreamReader(dir string, includeDirInPath bool) io.ReadCloser
CreateTarStreamReader returns an io.ReadCloser from which a tar stream can be read. The tar stream is created using CreateTarStream.
func (*FakeTar) CreateTarStreamToTarWriter ¶ added in v1.1.4
func (f *FakeTar) CreateTarStreamToTarWriter(dir string, includeDirInPath bool, writer tar.Writer, logger io.Writer) error
CreateTarStreamToTarWriter creates a tar from the given directory and streams it to the given writer.
func (*FakeTar) ExtractTarStream ¶
ExtractTarStream streams a content of fake tar
func (*FakeTar) ExtractTarStreamFromTarReader ¶ added in v1.1.3
func (f *FakeTar) ExtractTarStreamFromTarReader(dir string, tarReader tar.Reader, logger io.Writer) error
ExtractTarStreamFromTarReader streams a content of fake tar from a tar.Reader
func (*FakeTar) ExtractTarStreamWithLogging ¶ added in v1.0.4
ExtractTarStreamWithLogging streams a content of fake tar
func (*FakeTar) SetExclusionPattern ¶ added in v1.0.3
SetExclusionPattern sets the exclusion pattern