Documentation ¶
Overview ¶
helpers package provides some general functions that do not have a good home
helpers module creates a strategy to determine, where to put the files we copy from the cluster.
Index ¶
- Constants
- func ArchiveDiagDirectory(outputFile, outputDir string) error
- func GZipDiag(zipFileName string, _ string, file string) error
- func TarDiag(tarFileName string, baseDir string, files []CollectedFile) error
- type CollectedFile
- type CopyStrategyHC
- type FakeFile
- type FakeFileSystem
- func (f FakeFileSystem) Create(_ string) (File, error)
- func (f FakeFileSystem) Mkdir(_ string, _ os.FileMode) error
- func (f FakeFileSystem) MkdirAll(_ string, _ os.FileMode) error
- func (f FakeFileSystem) MkdirTemp(name string, pattern string) (string, error)
- func (f FakeFileSystem) Remove(_ string) error
- func (f FakeFileSystem) RemoveAll(_ string) error
- func (f FakeFileSystem) Stat(name string) (os.FileInfo, error)
- func (f FakeFileSystem) WriteFile(_ string, _ []byte, _ os.FileMode) error
- type File
- type Filesystem
- type RealFile
- type RealFileSystem
- func (f RealFileSystem) Create(name string) (File, error)
- func (f RealFileSystem) Mkdir(name string, perms os.FileMode) error
- func (f RealFileSystem) MkdirAll(name string, perms os.FileMode) error
- func (f RealFileSystem) MkdirTemp(name string, pattern string) (string, error)
- func (f RealFileSystem) Remove(path string) error
- func (f RealFileSystem) RemoveAll(path string) error
- func (f RealFileSystem) Stat(name string) (os.FileInfo, error)
- func (f RealFileSystem) WriteFile(name string, data []byte, perms os.FileMode) error
Constants ¶
View Source
const DirPerms fs.FileMode = 0750
Variables ¶
This section is empty.
Functions ¶
func ArchiveDiagDirectory ¶ added in v0.2.0
archiveDiagDirectory supports .tgz
Types ¶
type CollectedFile ¶ added in v0.2.0
type CopyStrategyHC ¶ added in v0.2.0
type CopyStrategyHC struct { StrategyName string // the name of the output strategy (defasult, healthcheck etc) TmpDir string // tmp dir used for staging files BaseDir string // the base dir of where the output is routed Fs Filesystem // filesystem interface (so we can pass in realof fake filesystem, assists testing) }
This struct holds the details we need to copy files. The strategy is used to determine where and in what format we copy the files
func NewHCCopyStrategy ¶ added in v0.2.0
func NewHCCopyStrategy(ddcfs Filesystem) *CopyStrategyHC
func (*CopyStrategyHC) ArchiveDiag ¶ added in v0.2.0
func (s *CopyStrategyHC) ArchiveDiag(o string, outputLoc string) error
Archive calls out to the main archive function
func (*CopyStrategyHC) ClusterPath ¶ added in v0.2.0
func (s *CopyStrategyHC) ClusterPath() (path string, err error)
func (*CopyStrategyHC) CreatePath ¶ added in v0.2.0
func (s *CopyStrategyHC) CreatePath(fileType, source, nodeType string) (path string, err error)
func (*CopyStrategyHC) GetTmpDir ¶ added in v0.3.0
func (s *CopyStrategyHC) GetTmpDir() string
type FakeFileSystem ¶
type FakeFileSystem struct { }
Fake filesystem wrapper
func NewFakeFileSystem ¶ added in v0.2.0
func NewFakeFileSystem() *FakeFileSystem
func (FakeFileSystem) MkdirAll ¶
func (f FakeFileSystem) MkdirAll(_ string, _ os.FileMode) error
MkdirAll
type Filesystem ¶
type Filesystem interface { Stat(name string) (os.FileInfo, error) Create(name string) (File, error) MkdirAll(path string, perm os.FileMode) error Mkdir(path string, perm os.FileMode) error MkdirTemp(name string, pattern string) (string, error) RemoveAll(path string) error Remove(name string) error WriteFile(name string, data []byte, perms os.FileMode) error }
type RealFileSystem ¶ added in v0.2.0
type RealFileSystem struct { }
Rea fileSystem wrapper
func NewRealFileSystem ¶ added in v0.2.0
func NewRealFileSystem() *RealFileSystem
func (RealFileSystem) Create ¶ added in v0.2.0
func (f RealFileSystem) Create(name string) (File, error)
Create
func (RealFileSystem) Mkdir ¶ added in v0.2.0
func (f RealFileSystem) Mkdir(name string, perms os.FileMode) error
Mkdir
func (RealFileSystem) MkdirAll ¶ added in v0.2.0
func (f RealFileSystem) MkdirAll(name string, perms os.FileMode) error
MkdirAll
func (RealFileSystem) MkdirTemp ¶ added in v0.2.0
func (f RealFileSystem) MkdirTemp(name string, pattern string) (string, error)
MkdirTemp
func (RealFileSystem) Remove ¶ added in v0.2.0
func (f RealFileSystem) Remove(path string) error
Remove
func (RealFileSystem) RemoveAll ¶ added in v0.2.0
func (f RealFileSystem) RemoveAll(path string) error
RemoveAll
Click to show internal directories.
Click to hide internal directories.