Documentation
¶
Index ¶
- func CloseFileIgnoreError(f ClosableFile)
- func ExtractTarGz(fileIo FileIO, filename, destDir string) error
- func ExtractTarGzSingleFile(fileIo FileIO, archiveFile, fileToExtract, destDir string) error
- func ExtractTarSingleFile(fileIo FileIO, archiveFile, fileToExtract, destDir string) error
- func GetTableWriter() table.Writer
- func MarkFlagRequired(cmd *cobra.Command, name string)
- func StreamFileFromGzip(reader io.Reader, filename string) (io.Reader, error)
- type ClosableFile
- type FileIO
- type FilesystemWriter
- func (fs *FilesystemWriter) Create(filename string) (*os.File, error)
- func (fs *FilesystemWriter) Exists(path string) bool
- func (fs *FilesystemWriter) IsDirectory(path string) (bool, error)
- func (fs *FilesystemWriter) MkdirAll(path string, perm os.FileMode) error
- func (fs *FilesystemWriter) Open(filename string) (*os.File, error)
- func (fs *FilesystemWriter) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- type MockClosableFile
- type MockClosableFile_Close_Call
- type MockClosableFile_Expecter
- type MockFileIO
- func (_mock *MockFileIO) Create(filename string) (*os.File, error)
- func (_m *MockFileIO) EXPECT() *MockFileIO_Expecter
- func (_mock *MockFileIO) Exists(filename string) bool
- func (_mock *MockFileIO) IsDirectory(filename string) (bool, error)
- func (_mock *MockFileIO) MkdirAll(path string, perm os.FileMode) error
- func (_mock *MockFileIO) Open(filename string) (*os.File, error)
- func (_mock *MockFileIO) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- type MockFileIO_Create_Call
- type MockFileIO_Exists_Call
- type MockFileIO_Expecter
- func (_e *MockFileIO_Expecter) Create(filename interface{}) *MockFileIO_Create_Call
- func (_e *MockFileIO_Expecter) Exists(filename interface{}) *MockFileIO_Exists_Call
- func (_e *MockFileIO_Expecter) IsDirectory(filename interface{}) *MockFileIO_IsDirectory_Call
- func (_e *MockFileIO_Expecter) MkdirAll(path interface{}, perm interface{}) *MockFileIO_MkdirAll_Call
- func (_e *MockFileIO_Expecter) Open(filename interface{}) *MockFileIO_Open_Call
- func (_e *MockFileIO_Expecter) OpenFile(name interface{}, flag interface{}, perm interface{}) *MockFileIO_OpenFile_Call
- type MockFileIO_IsDirectory_Call
- func (_c *MockFileIO_IsDirectory_Call) Return(b bool, err error) *MockFileIO_IsDirectory_Call
- func (_c *MockFileIO_IsDirectory_Call) Run(run func(filename string)) *MockFileIO_IsDirectory_Call
- func (_c *MockFileIO_IsDirectory_Call) RunAndReturn(run func(filename string) (bool, error)) *MockFileIO_IsDirectory_Call
- type MockFileIO_MkdirAll_Call
- func (_c *MockFileIO_MkdirAll_Call) Return(err error) *MockFileIO_MkdirAll_Call
- func (_c *MockFileIO_MkdirAll_Call) Run(run func(path string, perm os.FileMode)) *MockFileIO_MkdirAll_Call
- func (_c *MockFileIO_MkdirAll_Call) RunAndReturn(run func(path string, perm os.FileMode) error) *MockFileIO_MkdirAll_Call
- type MockFileIO_OpenFile_Call
- func (_c *MockFileIO_OpenFile_Call) Return(file *os.File, err error) *MockFileIO_OpenFile_Call
- func (_c *MockFileIO_OpenFile_Call) Run(run func(name string, flag int, perm os.FileMode)) *MockFileIO_OpenFile_Call
- func (_c *MockFileIO_OpenFile_Call) RunAndReturn(run func(name string, flag int, perm os.FileMode) (*os.File, error)) *MockFileIO_OpenFile_Call
- type MockFileIO_Open_Call
- type MockTableWriter
- type MockTableWriter_AppendHeader_Call
- func (_c *MockTableWriter_AppendHeader_Call) Return() *MockTableWriter_AppendHeader_Call
- func (_c *MockTableWriter_AppendHeader_Call) Run(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendHeader_Call
- func (_c *MockTableWriter_AppendHeader_Call) RunAndReturn(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendHeader_Call
- type MockTableWriter_AppendRow_Call
- func (_c *MockTableWriter_AppendRow_Call) Return() *MockTableWriter_AppendRow_Call
- func (_c *MockTableWriter_AppendRow_Call) Run(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendRow_Call
- func (_c *MockTableWriter_AppendRow_Call) RunAndReturn(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendRow_Call
- type MockTableWriter_Expecter
- func (_e *MockTableWriter_Expecter) AppendHeader(row interface{}, configs ...interface{}) *MockTableWriter_AppendHeader_Call
- func (_e *MockTableWriter_Expecter) AppendRow(row interface{}, configs ...interface{}) *MockTableWriter_AppendRow_Call
- func (_e *MockTableWriter_Expecter) Render() *MockTableWriter_Render_Call
- type MockTableWriter_Render_Call
- type TableWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseFileIgnoreError ¶ added in v0.10.0
func CloseFileIgnoreError(f ClosableFile)
Close file and ignore error. This function is to be used with defer only.
func ExtractTarGz ¶ added in v0.10.0
ExtractTarGz takes a path to a .tar.gz file and extracts its contents to the specified destination directory.
func ExtractTarGzSingleFile ¶ added in v0.10.0
ExtractTarGzSingleFile extracts a single specified file from a .tar.gz archive to the destination directory.
func ExtractTarSingleFile ¶ added in v0.10.0
ExtractTarSingleFile extracts a single specified file from a .tar archive to the destination directory.
func GetTableWriter ¶
func MarkFlagRequired ¶ added in v0.9.0
Types ¶
type ClosableFile ¶ added in v0.10.0
type ClosableFile interface {
Close() error
}
type FilesystemWriter ¶
type FilesystemWriter struct{}
func NewFilesystemWriter ¶
func NewFilesystemWriter() *FilesystemWriter
func (*FilesystemWriter) Create ¶
func (fs *FilesystemWriter) Create(filename string) (*os.File, error)
func (*FilesystemWriter) Exists ¶ added in v0.10.0
func (fs *FilesystemWriter) Exists(path string) bool
func (*FilesystemWriter) IsDirectory ¶ added in v0.10.0
func (fs *FilesystemWriter) IsDirectory(path string) (bool, error)
func (*FilesystemWriter) MkdirAll ¶ added in v0.10.0
func (fs *FilesystemWriter) MkdirAll(path string, perm os.FileMode) error
type MockClosableFile ¶ added in v0.10.0
MockClosableFile is an autogenerated mock type for the ClosableFile type
func NewMockClosableFile ¶ added in v0.10.0
func NewMockClosableFile(t interface {
mock.TestingT
Cleanup(func())
}) *MockClosableFile
NewMockClosableFile creates a new instance of MockClosableFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockClosableFile) Close ¶ added in v0.10.0
func (_mock *MockClosableFile) Close() error
Close provides a mock function for the type MockClosableFile
func (*MockClosableFile) EXPECT ¶ added in v0.10.0
func (_m *MockClosableFile) EXPECT() *MockClosableFile_Expecter
type MockClosableFile_Close_Call ¶ added in v0.10.0
MockClosableFile_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockClosableFile_Close_Call) Return ¶ added in v0.10.0
func (_c *MockClosableFile_Close_Call) Return(err error) *MockClosableFile_Close_Call
func (*MockClosableFile_Close_Call) Run ¶ added in v0.10.0
func (_c *MockClosableFile_Close_Call) Run(run func()) *MockClosableFile_Close_Call
func (*MockClosableFile_Close_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockClosableFile_Close_Call) RunAndReturn(run func() error) *MockClosableFile_Close_Call
type MockClosableFile_Expecter ¶ added in v0.10.0
type MockClosableFile_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClosableFile_Expecter) Close ¶ added in v0.10.0
func (_e *MockClosableFile_Expecter) Close() *MockClosableFile_Close_Call
Close is a helper method to define mock.On call
type MockFileIO ¶ added in v0.10.0
MockFileIO is an autogenerated mock type for the FileIO type
func NewMockFileIO ¶ added in v0.10.0
func NewMockFileIO(t interface {
mock.TestingT
Cleanup(func())
}) *MockFileIO
NewMockFileIO creates a new instance of MockFileIO. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockFileIO) Create ¶ added in v0.10.0
func (_mock *MockFileIO) Create(filename string) (*os.File, error)
Create provides a mock function for the type MockFileIO
func (*MockFileIO) EXPECT ¶ added in v0.10.0
func (_m *MockFileIO) EXPECT() *MockFileIO_Expecter
func (*MockFileIO) Exists ¶ added in v0.10.0
func (_mock *MockFileIO) Exists(filename string) bool
Exists provides a mock function for the type MockFileIO
func (*MockFileIO) IsDirectory ¶ added in v0.10.0
func (_mock *MockFileIO) IsDirectory(filename string) (bool, error)
IsDirectory provides a mock function for the type MockFileIO
func (*MockFileIO) MkdirAll ¶ added in v0.10.0
func (_mock *MockFileIO) MkdirAll(path string, perm os.FileMode) error
MkdirAll provides a mock function for the type MockFileIO
type MockFileIO_Create_Call ¶ added in v0.10.0
MockFileIO_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockFileIO_Create_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_Create_Call) Return(file *os.File, err error) *MockFileIO_Create_Call
func (*MockFileIO_Create_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_Create_Call) Run(run func(filename string)) *MockFileIO_Create_Call
func (*MockFileIO_Create_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_Create_Call) RunAndReturn(run func(filename string) (*os.File, error)) *MockFileIO_Create_Call
type MockFileIO_Exists_Call ¶ added in v0.10.0
MockFileIO_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists'
func (*MockFileIO_Exists_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_Exists_Call) Return(b bool) *MockFileIO_Exists_Call
func (*MockFileIO_Exists_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_Exists_Call) Run(run func(filename string)) *MockFileIO_Exists_Call
func (*MockFileIO_Exists_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_Exists_Call) RunAndReturn(run func(filename string) bool) *MockFileIO_Exists_Call
type MockFileIO_Expecter ¶ added in v0.10.0
type MockFileIO_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFileIO_Expecter) Create ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) Create(filename interface{}) *MockFileIO_Create_Call
Create is a helper method to define mock.On call
- filename
func (*MockFileIO_Expecter) Exists ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) Exists(filename interface{}) *MockFileIO_Exists_Call
Exists is a helper method to define mock.On call
- filename
func (*MockFileIO_Expecter) IsDirectory ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) IsDirectory(filename interface{}) *MockFileIO_IsDirectory_Call
IsDirectory is a helper method to define mock.On call
- filename
func (*MockFileIO_Expecter) MkdirAll ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) MkdirAll(path interface{}, perm interface{}) *MockFileIO_MkdirAll_Call
MkdirAll is a helper method to define mock.On call
- path
- perm
func (*MockFileIO_Expecter) Open ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) Open(filename interface{}) *MockFileIO_Open_Call
Open is a helper method to define mock.On call
- filename
func (*MockFileIO_Expecter) OpenFile ¶ added in v0.10.0
func (_e *MockFileIO_Expecter) OpenFile(name interface{}, flag interface{}, perm interface{}) *MockFileIO_OpenFile_Call
OpenFile is a helper method to define mock.On call
- name
- flag
- perm
type MockFileIO_IsDirectory_Call ¶ added in v0.10.0
MockFileIO_IsDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDirectory'
func (*MockFileIO_IsDirectory_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_IsDirectory_Call) Return(b bool, err error) *MockFileIO_IsDirectory_Call
func (*MockFileIO_IsDirectory_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_IsDirectory_Call) Run(run func(filename string)) *MockFileIO_IsDirectory_Call
func (*MockFileIO_IsDirectory_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_IsDirectory_Call) RunAndReturn(run func(filename string) (bool, error)) *MockFileIO_IsDirectory_Call
type MockFileIO_MkdirAll_Call ¶ added in v0.10.0
MockFileIO_MkdirAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MkdirAll'
func (*MockFileIO_MkdirAll_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_MkdirAll_Call) Return(err error) *MockFileIO_MkdirAll_Call
func (*MockFileIO_MkdirAll_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_MkdirAll_Call) Run(run func(path string, perm os.FileMode)) *MockFileIO_MkdirAll_Call
func (*MockFileIO_MkdirAll_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_MkdirAll_Call) RunAndReturn(run func(path string, perm os.FileMode) error) *MockFileIO_MkdirAll_Call
type MockFileIO_OpenFile_Call ¶ added in v0.10.0
MockFileIO_OpenFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenFile'
func (*MockFileIO_OpenFile_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_OpenFile_Call) Return(file *os.File, err error) *MockFileIO_OpenFile_Call
func (*MockFileIO_OpenFile_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_OpenFile_Call) Run(run func(name string, flag int, perm os.FileMode)) *MockFileIO_OpenFile_Call
func (*MockFileIO_OpenFile_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_OpenFile_Call) RunAndReturn(run func(name string, flag int, perm os.FileMode) (*os.File, error)) *MockFileIO_OpenFile_Call
type MockFileIO_Open_Call ¶ added in v0.10.0
MockFileIO_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
func (*MockFileIO_Open_Call) Return ¶ added in v0.10.0
func (_c *MockFileIO_Open_Call) Return(file *os.File, err error) *MockFileIO_Open_Call
func (*MockFileIO_Open_Call) Run ¶ added in v0.10.0
func (_c *MockFileIO_Open_Call) Run(run func(filename string)) *MockFileIO_Open_Call
func (*MockFileIO_Open_Call) RunAndReturn ¶ added in v0.10.0
func (_c *MockFileIO_Open_Call) RunAndReturn(run func(filename string) (*os.File, error)) *MockFileIO_Open_Call
type MockTableWriter ¶
MockTableWriter is an autogenerated mock type for the TableWriter type
func NewMockTableWriter ¶
func NewMockTableWriter(t interface {
mock.TestingT
Cleanup(func())
}) *MockTableWriter
NewMockTableWriter creates a new instance of MockTableWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTableWriter) AppendHeader ¶
func (_mock *MockTableWriter) AppendHeader(row table.Row, configs ...table.RowConfig)
AppendHeader provides a mock function for the type MockTableWriter
func (*MockTableWriter) AppendRow ¶
func (_mock *MockTableWriter) AppendRow(row table.Row, configs ...table.RowConfig)
AppendRow provides a mock function for the type MockTableWriter
func (*MockTableWriter) EXPECT ¶
func (_m *MockTableWriter) EXPECT() *MockTableWriter_Expecter
func (*MockTableWriter) Render ¶
func (_mock *MockTableWriter) Render() string
Render provides a mock function for the type MockTableWriter
type MockTableWriter_AppendHeader_Call ¶
MockTableWriter_AppendHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendHeader'
func (*MockTableWriter_AppendHeader_Call) Return ¶
func (_c *MockTableWriter_AppendHeader_Call) Return() *MockTableWriter_AppendHeader_Call
func (*MockTableWriter_AppendHeader_Call) Run ¶
func (_c *MockTableWriter_AppendHeader_Call) Run(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendHeader_Call
func (*MockTableWriter_AppendHeader_Call) RunAndReturn ¶
func (_c *MockTableWriter_AppendHeader_Call) RunAndReturn(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendHeader_Call
type MockTableWriter_AppendRow_Call ¶
MockTableWriter_AppendRow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendRow'
func (*MockTableWriter_AppendRow_Call) Return ¶
func (_c *MockTableWriter_AppendRow_Call) Return() *MockTableWriter_AppendRow_Call
func (*MockTableWriter_AppendRow_Call) Run ¶
func (_c *MockTableWriter_AppendRow_Call) Run(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendRow_Call
func (*MockTableWriter_AppendRow_Call) RunAndReturn ¶
func (_c *MockTableWriter_AppendRow_Call) RunAndReturn(run func(row table.Row, configs ...table.RowConfig)) *MockTableWriter_AppendRow_Call
type MockTableWriter_Expecter ¶
type MockTableWriter_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTableWriter_Expecter) AppendHeader ¶
func (_e *MockTableWriter_Expecter) AppendHeader(row interface{}, configs ...interface{}) *MockTableWriter_AppendHeader_Call
AppendHeader is a helper method to define mock.On call
- row
- configs
func (*MockTableWriter_Expecter) AppendRow ¶
func (_e *MockTableWriter_Expecter) AppendRow(row interface{}, configs ...interface{}) *MockTableWriter_AppendRow_Call
AppendRow is a helper method to define mock.On call
- row
- configs
func (*MockTableWriter_Expecter) Render ¶
func (_e *MockTableWriter_Expecter) Render() *MockTableWriter_Render_Call
Render is a helper method to define mock.On call
type MockTableWriter_Render_Call ¶
MockTableWriter_Render_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Render'
func (*MockTableWriter_Render_Call) Return ¶
func (_c *MockTableWriter_Render_Call) Return(s string) *MockTableWriter_Render_Call
func (*MockTableWriter_Render_Call) Run ¶
func (_c *MockTableWriter_Render_Call) Run(run func()) *MockTableWriter_Render_Call
func (*MockTableWriter_Render_Call) RunAndReturn ¶
func (_c *MockTableWriter_Render_Call) RunAndReturn(run func() string) *MockTableWriter_Render_Call