Documentation
¶
Overview ¶
Package utils contains small utilities used by the imager.
Index ¶
- func CopyFiles(printf func(string, ...any), instructions ...CopyInstruction) error
- func CopyReader(printf func(string, ...any), instructions ...CopyReaderInstruction) error
- func CreateRawDisk(printf func(string, ...any), path string, diskSize int64, allocate bool) error
- func SourceDateEpoch() (int64, bool, error)
- func SourceDateEpochTime() (time.Time, error)
- func TouchFiles(printf func(string, ...any), root string) error
- type CopyInstruction
- type CopyReaderInstruction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFiles ¶
func CopyFiles(printf func(string, ...any), instructions ...CopyInstruction) error
CopyFiles copies files according to the given instructions.
func CopyReader ¶ added in v1.10.0
func CopyReader(printf func(string, ...any), instructions ...CopyReaderInstruction) error
CopyReader copies readers according to the given instructions.
func CreateRawDisk ¶
CreateRawDisk creates a raw disk image of the specified size.
func SourceDateEpoch ¶
SourceDateEpoch returns parsed value of SOURCE_DATE_EPOCH.
func SourceDateEpochTime ¶ added in v1.14.3
SourceDateEpochTime returns the build timestamp as a time.Time in UTC.
If SOURCE_DATE_EPOCH is set, it is used, otherwise the current time is returned.
The returned time is always in UTC, so that it serializes identically regardless of the local timezone of the build host (e.g. in OCI image config 'created' field).
Types ¶
type CopyInstruction ¶
CopyInstruction describes a file copy operation.
func SourceDestination ¶
func SourceDestination(src, dest string) CopyInstruction
SourceDestination returns a CopyInstruction that copies src to dest.
type CopyReaderInstruction ¶ added in v1.10.0
CopyReaderInstruction describes a reader copy operation.
func ReaderDestination ¶ added in v1.10.0
func ReaderDestination(reader io.Reader, dest string) CopyReaderInstruction
ReaderDestination returns a CopyReaderInstruction that copies reader to dest.