Documentation ¶
Index ¶
- Constants
- func BuildTar(ents []TarEntry, opts ...Option) io.Reader
- func EnsureHello(ctx context.Context) (*ocispec.Descriptor, content.Store, error)
- type DirectoryOption
- type FileOption
- type Option
- type Options
- type TarEntry
- func Blockdev(name string, major, minor int64) TarEntry
- func Chardev(name string, major, minor int64) TarEntry
- func Dir(name string, opts ...DirectoryOption) TarEntry
- func Fifo(name string) TarEntry
- func File(name, contents string, opts ...FileOption) TarEntry
- func Link(name, linkname string) TarEntry
- func Symlink(name, target string) TarEntry
Constants ¶
const ( // HelloArchiveURL points to an OCI archive of `hello-world`. // Exported from `docker.io/library/hello-world@sha256:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec` . // See https://github.com/AkihiroSuda/test-oci-archives/releases/tag/v20210101 HelloArchiveURL = "https://github.com/AkihiroSuda/test-oci-archives/releases/download/v20210101/hello-world.tar.gz" // HelloArchiveDigest is the digest of the archive. HelloArchiveDigest = "sha256:5aa022621c4de0e941ab2a30d4569c403e156b4ba2de2ec32e382ae8679f40e1" )
Variables ¶
This section is empty.
Functions ¶
func EnsureHello ¶
EnsureHello creates a temp content store and ensures `hello-world` image from HelloArchiveURL into the store.
Types ¶
type DirectoryOption ¶ added in v0.4.0
type DirectoryOption func(o *dirOpts)
DirecoryOption is an option for a directory entry.
func WithDirMode ¶ added in v0.5.0
func WithDirMode(mode os.FileMode) DirectoryOption
WithFileMode specifies the mode of the directory.
func WithDirOwner ¶ added in v0.4.0
func WithDirOwner(uid, gid int) DirectoryOption
WithDirOwner specifies the owner of the directory.
func WithDirXattrs ¶ added in v0.5.0
func WithDirXattrs(xattrs map[string]string) DirectoryOption
WithDirXattrs specifies the extended attributes of the directory.
type FileOption ¶ added in v0.4.0
type FileOption func(o *fileOpts)
FileOption is an option for a file entry.
func WithFileMode ¶ added in v0.5.0
func WithFileMode(mode os.FileMode) FileOption
WithFileMode specifies the mode of the file.
func WithFileOwner ¶ added in v0.4.0
func WithFileOwner(uid, gid int) FileOption
WithFileOwner specifies the owner of the file.
func WithFileXattrs ¶ added in v0.4.0
func WithFileXattrs(xattrs map[string]string) FileOption
WithFileXattrs specifies the extended attributes of the file.
type Option ¶ added in v0.4.0
type Option func(o *Options)
Options is an option used during building blob.
func WithPrefix ¶ added in v0.4.0
WithPrefix is an option to add a prefix string to each file name (e.g. "./", "/", etc.)
type Options ¶ added in v0.4.0
type Options struct { // Prefix is the prefix string need to be added to each file name (e.g. "./", "/", etc.) Prefix string }
Option is a set of options used during building blob.
type TarEntry ¶ added in v0.4.0
TarEntry is an entry of tar.
func Dir ¶ added in v0.4.0
func Dir(name string, opts ...DirectoryOption) TarEntry
Dir is a directory entry
func File ¶ added in v0.4.0
func File(name, contents string, opts ...FileOption) TarEntry
File is a regilar file entry