Documentation
¶
Index ¶
- func ApplySecretFromYAML(ctx context.Context, clientset kubernetes.Interface, data []byte) error
- func ApplyUnstructured(ctx context.Context, dynClient dynamic.Interface, ...) error
- func CloseFileIgnoreError(f ClosableFile)
- func DecodeMultiDocYAML(data []byte) ([]*unstructured.Unstructured, error)
- func DeepMergeMaps(dst, src map[string]any) map[string]any
- func ExpandPath(path string) string
- 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 GetDurationFromString(validFor string) (time.Duration, error)
- func GetTableWriter() table.Writer
- func GvrForUnstructured(obj *unstructured.Unstructured) (schema.GroupVersionResource, error)
- func IgnoreError(fn func() error)
- func MarkFlagRequired(cmd *cobra.Command, name string)
- func NewClients() (kubernetes.Interface, dynamic.Interface, error)
- func RenderTemplate(raw []byte, vars map[string]string) ([]byte, error)
- func RunCommand(command string, args []string, cmdDir string) error
- func StreamFileFromGzip(reader io.Reader, filename string) (io.Reader, error)
- func Truncate(s string, max int) string
- type ClosableFile
- type Dockerfile
- type DockerfileManager
- type FakeTime
- type FileIO
- type FilesystemWriter
- func (fs *FilesystemWriter) Chmod(name string, mode os.FileMode) error
- func (fs *FilesystemWriter) Create(filename string) (*os.File, error)
- func (fs *FilesystemWriter) CreateAndWrite(filePath string, data []byte, fileType string) 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) OpenAppend(filename string) (*os.File, error)
- func (fs *FilesystemWriter) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (fs *FilesystemWriter) ReadDir(dirname string) ([]os.DirEntry, error)
- func (fs *FilesystemWriter) ReadFile(filename string) ([]byte, error)
- func (fs *FilesystemWriter) Remove(path string) error
- func (fs *FilesystemWriter) WriteFile(filename string, data []byte, perm os.FileMode) error
- type MockFileIO
- func (_mock *MockFileIO) Chmod(name string, mode os.FileMode) error
- func (_mock *MockFileIO) Create(filename string) (*os.File, error)
- func (_mock *MockFileIO) CreateAndWrite(filePath string, data []byte, fileType string) 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) OpenAppend(filename string) (*os.File, error)
- func (_mock *MockFileIO) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (_mock *MockFileIO) ReadDir(dirname string) ([]os.DirEntry, error)
- func (_mock *MockFileIO) ReadFile(filename string) ([]byte, error)
- func (_mock *MockFileIO) Remove(path string) error
- func (_mock *MockFileIO) WriteFile(filename string, data []byte, perm os.FileMode) error
- type MockFileIO_Chmod_Call
- type MockFileIO_CreateAndWrite_Call
- func (_c *MockFileIO_CreateAndWrite_Call) Return(err error) *MockFileIO_CreateAndWrite_Call
- func (_c *MockFileIO_CreateAndWrite_Call) Run(run func(filePath string, data []byte, fileType string)) *MockFileIO_CreateAndWrite_Call
- func (_c *MockFileIO_CreateAndWrite_Call) RunAndReturn(run func(filePath string, data []byte, fileType string) error) *MockFileIO_CreateAndWrite_Call
- type MockFileIO_Create_Call
- type MockFileIO_Exists_Call
- type MockFileIO_Expecter
- func (_e *MockFileIO_Expecter) Chmod(name interface{}, mode interface{}) *MockFileIO_Chmod_Call
- func (_e *MockFileIO_Expecter) Create(filename interface{}) *MockFileIO_Create_Call
- func (_e *MockFileIO_Expecter) CreateAndWrite(filePath interface{}, data interface{}, fileType interface{}) *MockFileIO_CreateAndWrite_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) OpenAppend(filename interface{}) *MockFileIO_OpenAppend_Call
- func (_e *MockFileIO_Expecter) OpenFile(name interface{}, flag interface{}, perm interface{}) *MockFileIO_OpenFile_Call
- func (_e *MockFileIO_Expecter) ReadDir(dirname interface{}) *MockFileIO_ReadDir_Call
- func (_e *MockFileIO_Expecter) ReadFile(filename interface{}) *MockFileIO_ReadFile_Call
- func (_e *MockFileIO_Expecter) Remove(path interface{}) *MockFileIO_Remove_Call
- func (_e *MockFileIO_Expecter) WriteFile(filename interface{}, data interface{}, perm interface{}) *MockFileIO_WriteFile_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_OpenAppend_Call
- func (_c *MockFileIO_OpenAppend_Call) Return(file *os.File, err error) *MockFileIO_OpenAppend_Call
- func (_c *MockFileIO_OpenAppend_Call) Run(run func(filename string)) *MockFileIO_OpenAppend_Call
- func (_c *MockFileIO_OpenAppend_Call) RunAndReturn(run func(filename string) (*os.File, error)) *MockFileIO_OpenAppend_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 MockFileIO_ReadDir_Call
- func (_c *MockFileIO_ReadDir_Call) Return(vs []os.DirEntry, err error) *MockFileIO_ReadDir_Call
- func (_c *MockFileIO_ReadDir_Call) Run(run func(dirname string)) *MockFileIO_ReadDir_Call
- func (_c *MockFileIO_ReadDir_Call) RunAndReturn(run func(dirname string) ([]os.DirEntry, error)) *MockFileIO_ReadDir_Call
- type MockFileIO_ReadFile_Call
- func (_c *MockFileIO_ReadFile_Call) Return(bytes []byte, err error) *MockFileIO_ReadFile_Call
- func (_c *MockFileIO_ReadFile_Call) Run(run func(filename string)) *MockFileIO_ReadFile_Call
- func (_c *MockFileIO_ReadFile_Call) RunAndReturn(run func(filename string) ([]byte, error)) *MockFileIO_ReadFile_Call
- type MockFileIO_Remove_Call
- type MockFileIO_WriteFile_Call
- func (_c *MockFileIO_WriteFile_Call) Return(err error) *MockFileIO_WriteFile_Call
- func (_c *MockFileIO_WriteFile_Call) Run(run func(filename string, data []byte, perm os.FileMode)) *MockFileIO_WriteFile_Call
- func (_c *MockFileIO_WriteFile_Call) RunAndReturn(run func(filename string, data []byte, perm os.FileMode) error) *MockFileIO_WriteFile_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 RealTime
- type TableWriter
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySecretFromYAML ¶ added in v1.14.0
ApplySecretFromYAML creates or updates a corev1.Secret parsed from YAML bytes.
func ApplyUnstructured ¶ added in v1.14.0
func ApplyUnstructured(ctx context.Context, dynClient dynamic.Interface, gvr schema.GroupVersionResource, obj *unstructured.Unstructured) error
ApplyUnstructured creates or updates an unstructured resource using the dynamic client.
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 DecodeMultiDocYAML ¶ added in v1.14.0
func DecodeMultiDocYAML(data []byte) ([]*unstructured.Unstructured, error)
DecodeMultiDocYAML splits a multi-document YAML byte slice into individual unstructured objects. This handles the "---" separators.
func DeepMergeMaps ¶ added in v1.17.0
DeepMergeMaps recursively merges two maps of string to any, returning a new merged map. Values from the src map will overwrite those in dst when there are conflicts, except when both values are maps themselves, in which case they will be merged recursively. The original dst map is not modified; a new map is returned.
func ExpandPath ¶ added in v0.32.1
ExpandPath expands ~ to the user's home directory
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 GetDurationFromString ¶ added in v1.49.1
GetDurationFromString parses a string in the format "<days>d" and returns the corresponding time.Duration. It is intentionally built to be easily extensible in the future if we want to support more duration formats (e.g., "1h", "3m", etc.).
func GetTableWriter ¶
func GvrForUnstructured ¶ added in v1.14.0
func GvrForUnstructured(obj *unstructured.Unstructured) (schema.GroupVersionResource, error)
GvrForUnstructured maps an unstructured object's GVK to the appropriate GVR.
func IgnoreError ¶ added in v0.24.0
func IgnoreError(fn func() error)
func MarkFlagRequired ¶ added in v0.9.0
func NewClients ¶ added in v1.14.0
func NewClients() (kubernetes.Interface, dynamic.Interface, error)
newClients creates both a typed and dynamic Kubernetes client using the current kubeconfig context (respects KUBECONFIG env var and defaults to ~/.kube/config).
func RenderTemplate ¶ added in v1.14.0
RenderTemplate performs simple ${VAR} substitution on a raw byte slice.
func RunCommand ¶ added in v0.17.0
func StreamFileFromGzip ¶
StreamFileFromGzip creates a new streamer for a specific file in a tar.gz
Types ¶
type ClosableFile ¶ added in v0.10.0
type ClosableFile interface {
Close() error
}
type Dockerfile ¶ added in v0.15.0
type Dockerfile struct{}
func (*Dockerfile) UpdateFromStatement ¶ added in v0.15.0
UpdateFromStatement updates the FROM statement in a Dockerfile with a new base image
type DockerfileManager ¶ added in v0.15.0
type DockerfileManager interface {
UpdateFromStatement(dockerfile io.Reader, baseImage string) (string, error)
}
DockerfileManager provides functionality to parse and modify Dockerfiles
func NewDockerfileManager ¶ added in v0.15.0
func NewDockerfileManager() DockerfileManager
NewDockerfileManager creates a new instance of DockerfileManager
type FakeTime ¶ added in v1.17.0
func NewFakeTime ¶ added in v1.17.0
func NewFakeTime() *FakeTime
type FileIO ¶ added in v0.10.0
type FileIO interface {
Create(filename string) (*os.File, error)
Open(filename string) (*os.File, error)
OpenAppend(filename string) (*os.File, error)
Exists(filename string) bool
IsDirectory(filename string) (bool, error)
MkdirAll(path string, perm os.FileMode) error
OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
WriteFile(filename string, data []byte, perm os.FileMode) error
ReadDir(dirname string) ([]os.DirEntry, error)
ReadFile(filename string) ([]byte, error)
CreateAndWrite(filePath string, data []byte, fileType string) error
Remove(path string) error
Chmod(name string, mode os.FileMode) error
}
type FilesystemWriter ¶
type FilesystemWriter struct{}
func NewFilesystemWriter ¶
func NewFilesystemWriter() *FilesystemWriter
func (*FilesystemWriter) Chmod ¶ added in v1.40.0
func (fs *FilesystemWriter) Chmod(name string, mode os.FileMode) error
func (*FilesystemWriter) Create ¶
func (fs *FilesystemWriter) Create(filename string) (*os.File, error)
func (*FilesystemWriter) CreateAndWrite ¶ added in v0.17.0
func (fs *FilesystemWriter) CreateAndWrite(filePath string, data []byte, fileType string) 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
func (*FilesystemWriter) Open ¶ added in v0.10.0
func (fs *FilesystemWriter) Open(filename string) (*os.File, error)
func (*FilesystemWriter) OpenAppend ¶ added in v0.16.0
func (fs *FilesystemWriter) OpenAppend(filename string) (*os.File, error)
func (*FilesystemWriter) ReadDir ¶ added in v0.14.0
func (fs *FilesystemWriter) ReadDir(dirname string) ([]os.DirEntry, error)
func (*FilesystemWriter) ReadFile ¶ added in v0.24.0
func (fs *FilesystemWriter) ReadFile(filename string) ([]byte, error)
func (*FilesystemWriter) Remove ¶ added in v1.16.0
func (fs *FilesystemWriter) Remove(path string) error
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) Chmod ¶ added in v1.40.0
func (_mock *MockFileIO) Chmod(name string, mode os.FileMode) error
Chmod provides a mock function for the type MockFileIO
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) CreateAndWrite ¶ added in v0.17.0
func (_mock *MockFileIO) CreateAndWrite(filePath string, data []byte, fileType string) error
CreateAndWrite 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
func (*MockFileIO) Open ¶ added in v0.10.0
func (_mock *MockFileIO) Open(filename string) (*os.File, error)
Open provides a mock function for the type MockFileIO
func (*MockFileIO) OpenAppend ¶ added in v0.16.0
func (_mock *MockFileIO) OpenAppend(filename string) (*os.File, error)
OpenAppend provides a mock function for the type MockFileIO
func (*MockFileIO) OpenFile ¶ added in v0.10.0
OpenFile provides a mock function for the type MockFileIO
func (*MockFileIO) ReadDir ¶ added in v0.14.0
func (_mock *MockFileIO) ReadDir(dirname string) ([]os.DirEntry, error)
ReadDir provides a mock function for the type MockFileIO
func (*MockFileIO) ReadFile ¶ added in v0.24.0
func (_mock *MockFileIO) ReadFile(filename string) ([]byte, error)
ReadFile provides a mock function for the type MockFileIO
func (*MockFileIO) Remove ¶ added in v1.16.0
func (_mock *MockFileIO) Remove(path string) error
Remove provides a mock function for the type MockFileIO
type MockFileIO_Chmod_Call ¶ added in v1.40.0
MockFileIO_Chmod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chmod'
func (*MockFileIO_Chmod_Call) Return ¶ added in v1.40.0
func (_c *MockFileIO_Chmod_Call) Return(err error) *MockFileIO_Chmod_Call
func (*MockFileIO_Chmod_Call) Run ¶ added in v1.40.0
func (_c *MockFileIO_Chmod_Call) Run(run func(name string, mode os.FileMode)) *MockFileIO_Chmod_Call
func (*MockFileIO_Chmod_Call) RunAndReturn ¶ added in v1.40.0
func (_c *MockFileIO_Chmod_Call) RunAndReturn(run func(name string, mode os.FileMode) error) *MockFileIO_Chmod_Call
type MockFileIO_CreateAndWrite_Call ¶ added in v0.17.0
MockFileIO_CreateAndWrite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAndWrite'
func (*MockFileIO_CreateAndWrite_Call) Return ¶ added in v0.17.0
func (_c *MockFileIO_CreateAndWrite_Call) Return(err error) *MockFileIO_CreateAndWrite_Call
func (*MockFileIO_CreateAndWrite_Call) Run ¶ added in v0.17.0
func (_c *MockFileIO_CreateAndWrite_Call) Run(run func(filePath string, data []byte, fileType string)) *MockFileIO_CreateAndWrite_Call
func (*MockFileIO_CreateAndWrite_Call) RunAndReturn ¶ added in v0.17.0
func (_c *MockFileIO_CreateAndWrite_Call) RunAndReturn(run func(filePath string, data []byte, fileType string) error) *MockFileIO_CreateAndWrite_Call
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) Chmod ¶ added in v1.40.0
func (_e *MockFileIO_Expecter) Chmod(name interface{}, mode interface{}) *MockFileIO_Chmod_Call
Chmod is a helper method to define mock.On call
- name string
- mode os.FileMode
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 string
func (*MockFileIO_Expecter) CreateAndWrite ¶ added in v0.17.0
func (_e *MockFileIO_Expecter) CreateAndWrite(filePath interface{}, data interface{}, fileType interface{}) *MockFileIO_CreateAndWrite_Call
CreateAndWrite is a helper method to define mock.On call
- filePath string
- data []byte
- fileType string
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 string
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 string
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 string
- perm os.FileMode
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 string
func (*MockFileIO_Expecter) OpenAppend ¶ added in v0.16.0
func (_e *MockFileIO_Expecter) OpenAppend(filename interface{}) *MockFileIO_OpenAppend_Call
OpenAppend is a helper method to define mock.On call
- filename string
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 string
- flag int
- perm os.FileMode
func (*MockFileIO_Expecter) ReadDir ¶ added in v0.14.0
func (_e *MockFileIO_Expecter) ReadDir(dirname interface{}) *MockFileIO_ReadDir_Call
ReadDir is a helper method to define mock.On call
- dirname string
func (*MockFileIO_Expecter) ReadFile ¶ added in v0.24.0
func (_e *MockFileIO_Expecter) ReadFile(filename interface{}) *MockFileIO_ReadFile_Call
ReadFile is a helper method to define mock.On call
- filename string
func (*MockFileIO_Expecter) Remove ¶ added in v1.16.0
func (_e *MockFileIO_Expecter) Remove(path interface{}) *MockFileIO_Remove_Call
Remove is a helper method to define mock.On call
- path string
func (*MockFileIO_Expecter) WriteFile ¶ added in v0.15.0
func (_e *MockFileIO_Expecter) WriteFile(filename interface{}, data interface{}, perm interface{}) *MockFileIO_WriteFile_Call
WriteFile is a helper method to define mock.On call
- filename string
- data []byte
- perm os.FileMode
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_OpenAppend_Call ¶ added in v0.16.0
MockFileIO_OpenAppend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenAppend'
func (*MockFileIO_OpenAppend_Call) Return ¶ added in v0.16.0
func (_c *MockFileIO_OpenAppend_Call) Return(file *os.File, err error) *MockFileIO_OpenAppend_Call
func (*MockFileIO_OpenAppend_Call) Run ¶ added in v0.16.0
func (_c *MockFileIO_OpenAppend_Call) Run(run func(filename string)) *MockFileIO_OpenAppend_Call
func (*MockFileIO_OpenAppend_Call) RunAndReturn ¶ added in v0.16.0
func (_c *MockFileIO_OpenAppend_Call) RunAndReturn(run func(filename string) (*os.File, error)) *MockFileIO_OpenAppend_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 MockFileIO_ReadDir_Call ¶ added in v0.14.0
MockFileIO_ReadDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadDir'
func (*MockFileIO_ReadDir_Call) Return ¶ added in v0.14.0
func (_c *MockFileIO_ReadDir_Call) Return(vs []os.DirEntry, err error) *MockFileIO_ReadDir_Call
func (*MockFileIO_ReadDir_Call) Run ¶ added in v0.14.0
func (_c *MockFileIO_ReadDir_Call) Run(run func(dirname string)) *MockFileIO_ReadDir_Call
func (*MockFileIO_ReadDir_Call) RunAndReturn ¶ added in v0.14.0
func (_c *MockFileIO_ReadDir_Call) RunAndReturn(run func(dirname string) ([]os.DirEntry, error)) *MockFileIO_ReadDir_Call
type MockFileIO_ReadFile_Call ¶ added in v0.24.0
MockFileIO_ReadFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFile'
func (*MockFileIO_ReadFile_Call) Return ¶ added in v0.24.0
func (_c *MockFileIO_ReadFile_Call) Return(bytes []byte, err error) *MockFileIO_ReadFile_Call
func (*MockFileIO_ReadFile_Call) Run ¶ added in v0.24.0
func (_c *MockFileIO_ReadFile_Call) Run(run func(filename string)) *MockFileIO_ReadFile_Call
func (*MockFileIO_ReadFile_Call) RunAndReturn ¶ added in v0.24.0
func (_c *MockFileIO_ReadFile_Call) RunAndReturn(run func(filename string) ([]byte, error)) *MockFileIO_ReadFile_Call
type MockFileIO_Remove_Call ¶ added in v1.16.0
MockFileIO_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
func (*MockFileIO_Remove_Call) Return ¶ added in v1.16.0
func (_c *MockFileIO_Remove_Call) Return(err error) *MockFileIO_Remove_Call
func (*MockFileIO_Remove_Call) Run ¶ added in v1.16.0
func (_c *MockFileIO_Remove_Call) Run(run func(path string)) *MockFileIO_Remove_Call
func (*MockFileIO_Remove_Call) RunAndReturn ¶ added in v1.16.0
func (_c *MockFileIO_Remove_Call) RunAndReturn(run func(path string) error) *MockFileIO_Remove_Call
type MockFileIO_WriteFile_Call ¶ added in v0.15.0
MockFileIO_WriteFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteFile'
func (*MockFileIO_WriteFile_Call) Return ¶ added in v0.15.0
func (_c *MockFileIO_WriteFile_Call) Return(err error) *MockFileIO_WriteFile_Call
func (*MockFileIO_WriteFile_Call) Run ¶ added in v0.15.0
func (_c *MockFileIO_WriteFile_Call) Run(run func(filename string, data []byte, perm os.FileMode)) *MockFileIO_WriteFile_Call
func (*MockFileIO_WriteFile_Call) RunAndReturn ¶ added in v0.15.0
func (_c *MockFileIO_WriteFile_Call) RunAndReturn(run func(filename string, data []byte, perm os.FileMode) error) *MockFileIO_WriteFile_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 table.Row
- configs ...table.RowConfig
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 table.Row
- configs ...table.RowConfig
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