Documentation ¶
Index ¶
- type Context
- type Option
- func WithOverrideGname(gname string) Option
- func WithOverridePerms(files []tar.Header) Option
- func WithOverrideUIDGID(uid, gid int) Option
- func WithOverrideUname(uname string) Option
- func WithRemapGIDs(gids map[int]int) Option
- func WithRemapUIDs(uids map[int]int) Option
- func WithSkipClose(skipClose bool) Option
- func WithSourceDateEpoch(t time.Time) Option
- func WithUseChecksums(useChecksums bool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { SourceDateEpoch time.Time OverrideUIDGID bool UID int GID int OverrideUname string OverrideGname string SkipClose bool UseChecksums bool // contains filtered or unexported fields }
func NewContext ¶
Generates a new context from a set of options.
func (*Context) WriteArchive
deprecated
WriteArchive writes a tarball to the provided io.Writer from the provided fs.FS. To override permissions, set the OverridePerms when creating the Context. If you need to get multiple filesystems, merge them prior to calling WriteArchive.
Deprecated: Use WriteTargz or WriteTar instead.
func (*Context) WriteTar ¶
WriteTar writes a tarball to the provided io.Writer from the provided fs.FS. To override permissions, set the OverridePerms when creating the Context. If you need to get multiple filesystems, merge them prior to calling WriteArchive. userinfosrc should be a fs which can provide an optionally provide an etc/passwd and etc/group file. The etc/passwd and etc/group file provide username and group name mappings for the tar.
func (*Context) WriteTargz ¶
WriteTargz writes a gzipped tarball to the provided io.Writer from the provided fs.FS. To override permissions, set the OverridePerms when creating the Context. If you need to get multiple filesystems, merge them prior to calling WriteArchive. userinfosrc should be a fs which can provide an optionally provide an etc/passwd and etc/group file. The etc/passwd and etc/group file provide username and group name mappings for the tar.
type Option ¶
func WithOverrideGname ¶
WithOverrideGname sets the Gname to use with Context.
func WithOverridePerms ¶
WithOverridePerms sets the UID/GID and file permissions to override with for specific files Context.
func WithOverrideUIDGID ¶
WithOverrideUIDGID sets the UID/GID to override with for all files for Context.
func WithOverrideUname ¶
WithOverrideUname sets the Uname to use with Context.
func WithRemapGIDs ¶
WithRemapGIDs sets a GID remapping in the Context.
func WithRemapUIDs ¶
WithRemapUIDs sets a UID remapping in the Context.
func WithSkipClose ¶
WithSkipClose is used to determine whether the tar stream should be closed. For concatenated tar streams such as APKv2 containers, only the final tar stream should be closed.
func WithSourceDateEpoch ¶
Sets SourceDateEpoch for Context.
func WithUseChecksums ¶
WithUseChecksums is used to determine whether the tar stream should have the APK-TOOLS.checksum.SHA1 extension.