Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TempFileManager ¶
type TempFileManager struct {
// contains filtered or unexported fields
}
TempFileManager manages temporary files created during image build. It maintains a list of created temporary files and provides cleanup functionality to ensure proper resource management.
func NewTempFileManager ¶
func NewTempFileManager() *TempFileManager
func (*TempFileManager) AddFile ¶
func (t *TempFileManager) AddFile(filename string)
func (*TempFileManager) Cleanup ¶
func (t *TempFileManager) Cleanup()
func (*TempFileManager) CreateTempFileFromReader ¶
func (t *TempFileManager) CreateTempFileFromReader(dest string, pattern string, reader io.Reader) (string, error)
CreateTempFileFromReader creates a temporary file in the specified destination directory with the given pattern, and copies content from the provided reader into the file. The created temporary file is automatically added to the manager's cleanup list.
Parameters:
- dest: The directory where the temporary file should be created
- pattern: The pattern for naming the temporary file
- reader: The io.Reader from which to read content to write into the temporary file
Returns:
- string: The path to the created temporary file
- error: Any error encountered during the operation
func (*TempFileManager) CreateTempSecret ¶
func (t *TempFileManager) CreateTempSecret(secretPath, contextDir string) (string, error)
CreateTempSecret creates a temporary copy of a secret file in the specified context directory. The original secret file is copied to a new temporary file which is automatically added to the manager's cleanup list.
Parameters:
- secretPath: The path to the source secret file to copy
- contextDir: The directory where the temporary secret file should be created
Returns:
- string: The path to the created temporary secret file
- error: Any error encountered during the operation