{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package extract\n\n## Functions\n\n```go\nfunc New(name string, streams genericclioptions.IOStreams) *cobra.Command\n```\nNew creates a new command\n\n## Types\n\n```go\ntype LayerFilter interface {\n\tFilter(layers []distribution.Descriptor) ([]distribution.Descriptor, error)\n}\n```\n\n```go\nfunc NewPositionLayerFilter(at int32) LayerFilter\n```\n\n```go\ntype LayerInfo struct {\n\tIndex      int\n\tDescriptor distribution.Descriptor\n\tMapping    *Mapping\n}\n```\n\n```go\ntype Mapping struct {\n\t// Name is provided for caller convenience for associating image callback metadata with a mapping\n\tName string\n\t// Image is the raw input image to extract\n\tImage string\n\t// ImageRef is the parsed version of the raw input image\n\tImageRef imagereference.DockerImageReference\n\t// LayerFilter can select which images to load\n\tLayerFilter LayerFilter\n\t// From is the directory or file in the image to extract\n\tFrom string\n\t// To is the directory to extract the contents of the directory or the named file into.\n\tTo string\n\t// ConditionFn is invoked before extracting the content and allows the set of images to be filtered.\n\tConditionFn func(m *Mapping, dgst digest.Digest, imageConfig *docker10.DockerImageConfig) (bool, error)\n}\n```\n\n```go\ntype Options struct {\n\tMappings []Mapping\n\n\tFiles []string\n\tPaths []string\n\n\tOnlyFiles           bool\n\tPreservePermissions bool\n\n\tSecurityOptions imagemanifest.SecurityOptions\n\tFilterOptions   imagemanifest.FilterOptions\n\tParallelOptions imagemanifest.ParallelOptions\n\n\tConfirm bool\n\tDryRun  bool\n\n\tgenericclioptions.IOStreams\n\n\t// ImageMetadataCallback is invoked once per image retrieved, and may be called in parallel if\n\t// MaxPerRegistry is set higher than 1.\n\tImageMetadataCallback func(m *Mapping, dgst, contentDigest digest.Digest, imageConfig *docker10.DockerImageConfig)\n\t// TarEntryCallback, if set, is passed each entry in the viewed layers. Entries will be filtered\n\t// by name and only the entry in the highest layer will be passed to the callback. Returning false\n\t// will halt processing of the image.\n\tTarEntryCallback TarEntryFunc\n\t// AllLayers ensures the TarEntryCallback is invoked for all files, and will cause the callback\n\t// order to start at the lowest layer and work outwards.\n\tAllLayers bool\n}\n```\n\n```go\nfunc NewOptions(streams genericclioptions.IOStreams) *Options\n```\n\n```go\nfunc (o *Options) Complete(cmd *cobra.Command, args []string) error\n```\n\n```go\nfunc (o *Options) Run() error\n```\n\n```go\nfunc (o *Options) Validate() error\n```\n\n```go\ntype TarEntryFunc func(*tar.Header, LayerInfo, io.Reader) (cont bool, err error)\n```\nTarEntryFunc is called once per entry in the tar file. It may return an error, or false to stop processing.\n\n","path":"github.com/2lambda123/openshift-origin/pkg/oc/cli/image/extract","name":"extract","synopsis":"","isRedistributable":true}
