Documentation ¶
Overview ¶
helpers package provides some general functions that do not have a good home
helpers package provides different functionality
helpers module creates a strategy to determine, where to put the files we copy from the cluster.
Index ¶
- Constants
- 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
- type RealTimeService
- type TimeService
Constants ¶
View Source
const DirPerms fs.FileMode = 0750
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectedFile ¶
type CopyStrategyHC ¶
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) TimeService TimeService }
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 ¶
func NewHCCopyStrategy(ddcfs Filesystem, timeService TimeService) *CopyStrategyHC
func (*CopyStrategyHC) ArchiveDiag ¶
func (s *CopyStrategyHC) ArchiveDiag(o string, outputLoc string) error
Archive calls out to the main archive function
func (*CopyStrategyHC) ClusterPath ¶
func (s *CopyStrategyHC) ClusterPath() (path string, err error)
func (*CopyStrategyHC) CreatePath ¶
func (s *CopyStrategyHC) CreatePath(fileType, source, nodeType string) (path string, err error)
func (*CopyStrategyHC) GetTmpDir ¶
func (s *CopyStrategyHC) GetTmpDir() string
type FakeFileSystem ¶
type FakeFileSystem struct { }
Fake filesystem wrapper
func NewFakeFileSystem ¶
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 }
fshelper provides functions to wrapper os file system calls to better facilitate testing
type RealFileSystem ¶
type RealFileSystem struct { }
Rea fileSystem wrapper
func NewRealFileSystem ¶
func NewRealFileSystem() *RealFileSystem
func (RealFileSystem) Mkdir ¶
func (f RealFileSystem) Mkdir(name string, perms os.FileMode) error
Mkdir
func (RealFileSystem) MkdirAll ¶
func (f RealFileSystem) MkdirAll(name string, perms os.FileMode) error
MkdirAll
type RealTimeService ¶ added in v0.6.0
type RealTimeService struct { }
func (*RealTimeService) GetNow ¶ added in v0.6.0
func (r *RealTimeService) GetNow() time.Time
type TimeService ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.