Documentation ¶
Overview ¶
Package builder provides a tar archive builder essentially for testing purposes.
Index ¶
- type ArchiveBuilder
- type HeaderModifier
- func WithAccessTime(accessTime time.Time) HeaderModifier
- func WithChangeTime(changeTime time.Time) HeaderModifier
- func WithGID(gid int) HeaderModifier
- func WithLinkname(linkname string) HeaderModifier
- func WithModTime(modTime time.Time) HeaderModifier
- func WithMode(mode int64) HeaderModifier
- func WithName(name string) HeaderModifier
- func WithSize(size int64) HeaderModifier
- func WithTypeflag(typeFlag byte) HeaderModifier
- func WithUID(uid int) HeaderModifier
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveBuilder ¶
type ArchiveBuilder struct {
// contains filtered or unexported fields
}
ArchiveBuilder is a tar archive builder.
func (*ArchiveBuilder) With ¶
func (b *ArchiveBuilder) With(bf ...Option) (*ArchiveBuilder, error)
With applies the given options to the builder.
type HeaderModifier ¶
HeaderModifier is a function that modifies a tar header.
func WithAccessTime ¶
func WithAccessTime(accessTime time.Time) HeaderModifier
WithAccessTime sets the access time of the header.
func WithChangeTime ¶
func WithChangeTime(changeTime time.Time) HeaderModifier
WithChangeTime sets the change time of the header.
func WithLinkname ¶
func WithLinkname(linkname string) HeaderModifier
WithLinkname sets the link name of the header.
func WithModTime ¶
func WithModTime(modTime time.Time) HeaderModifier
WithModTime sets the modification time of the header.
func WithTypeflag ¶
func WithTypeflag(typeFlag byte) HeaderModifier
WithTypeflag sets the type flag of the header.
type Option ¶
Option is a function that configures the builder.
func File ¶
func File(name string, r io.Reader, hm ...HeaderModifier) Option
File adds a file to the archive.
func Hardlink ¶
func Hardlink(name, target string, hm ...HeaderModifier) Option
Hardlink adds a hard link to the archive.
func Symlink ¶
func Symlink(name, target string, hm ...HeaderModifier) Option
Symlink adds a symbolic link to the archive.