writer

package
v0.7.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFsNodeWriter

func NewFsNodeWriter(root fs.FsNode, delegate fs.Writer) (w fs.Writer)

func NewHashingWriter

func NewHashingWriter(delegate fs.Writer) fs.Writer

func NewStringWriter

func NewStringWriter(writer io.Writer, attrs fs.AttrSet) (w fs.Writer)

Types

type DirWriter

type DirWriter struct {
	// contains filtered or unexported fields
}

A mapping file system writer that secures root directory boundaries. Derived from umoci's tar_extract.go to allow separate source/dest interfaces and filter archive contents on extraction

func NewDirWriter

func NewDirWriter(dir string, opts fs.FSOptions, warn log.Logger) (w *DirWriter)

func (*DirWriter) Close

func (w *DirWriter) Close() (err error)

func (*DirWriter) Device

func (w *DirWriter) Device(path string, a fs.DeviceAttrs) (err error)

func (*DirWriter) Dir

func (w *DirWriter) Dir(dir, base string, a fs.FileAttrs) (err error)

func (*DirWriter) Fifo

func (w *DirWriter) Fifo(file string, a fs.DeviceAttrs) (err error)

func (*DirWriter) File

func (w *DirWriter) File(file string, src fs.FileSource) (r fs.Source, err error)

func (*DirWriter) Lazy

func (w *DirWriter) Lazy(path, name string, src fs.LazySource, written map[fs.Source]string) (err error)
func (w *DirWriter) Link(file, target string) (err error)
func (w *DirWriter) LowerLink(path, target string, a *fs.NodeAttrs) error

func (*DirWriter) LowerNode

func (w *DirWriter) LowerNode(path, name string, a *fs.NodeAttrs) (err error)

func (*DirWriter) Mkdir

func (w *DirWriter) Mkdir(dir string) (err error)

func (*DirWriter) Parent

func (w *DirWriter) Parent() error

func (*DirWriter) Remove

func (w *DirWriter) Remove(file string) (err error)
func (w *DirWriter) Symlink(path string, a fs.FileAttrs) (err error)

type FsNodeWriter

type FsNodeWriter struct {
	// contains filtered or unexported fields
}

Writer that builds a node tree and delegates operations to wrapped writer using the inserted node's path.

func (*FsNodeWriter) Device

func (w *FsNodeWriter) Device(path string, a fs.DeviceAttrs) (err error)

func (*FsNodeWriter) Dir

func (w *FsNodeWriter) Dir(dir, base string, a fs.FileAttrs) (err error)

func (*FsNodeWriter) FS

func (w *FsNodeWriter) FS() fs.FsNode

func (*FsNodeWriter) Fifo

func (w *FsNodeWriter) Fifo(file string, a fs.DeviceAttrs) (err error)

func (*FsNodeWriter) File

func (w *FsNodeWriter) File(file string, src fs.FileSource) (r fs.Source, err error)

func (*FsNodeWriter) Lazy

func (w *FsNodeWriter) Lazy(path, name string, src fs.LazySource, written map[fs.Source]string) (err error)
func (w *FsNodeWriter) Link(path, target string) error
func (w *FsNodeWriter) LowerLink(path, target string, a *fs.NodeAttrs) error

func (*FsNodeWriter) LowerNode

func (w *FsNodeWriter) LowerNode(path, name string, a *fs.NodeAttrs) (err error)

func (*FsNodeWriter) Mkdir

func (w *FsNodeWriter) Mkdir(dir string) (err error)

func (*FsNodeWriter) Parent

func (w *FsNodeWriter) Parent() error

func (*FsNodeWriter) Remove

func (w *FsNodeWriter) Remove(file string) (err error)
func (w *FsNodeWriter) Symlink(path string, a fs.FileAttrs) (err error)

type HashingWriter

type HashingWriter struct {
	fs.Writer
}

func (*HashingWriter) File

func (w *HashingWriter) File(path string, src fs.FileSource) (fs.Source, error)

func (*HashingWriter) Lazy

func (w *HashingWriter) Lazy(path, name string, src fs.LazySource, written map[fs.Source]string) (err error)

type StringWriter

type StringWriter struct {
	// contains filtered or unexported fields
}

func (*StringWriter) Device

func (w *StringWriter) Device(path string, a fs.DeviceAttrs) (err error)

func (*StringWriter) Dir

func (w *StringWriter) Dir(path, name string, a fs.FileAttrs) (err error)

func (*StringWriter) Fifo

func (w *StringWriter) Fifo(path string, a fs.DeviceAttrs) (err error)

func (*StringWriter) File

func (w *StringWriter) File(path string, src fs.FileSource) (r fs.Source, err error)

func (*StringWriter) Lazy

func (w *StringWriter) Lazy(path, name string, src fs.LazySource, _ map[fs.Source]string) (err error)
func (w *StringWriter) Link(path, target string) (err error)
func (w *StringWriter) LowerLink(path, target string, a *fs.NodeAttrs) (err error)

func (*StringWriter) LowerNode

func (w *StringWriter) LowerNode(path, name string, a *fs.NodeAttrs) (err error)

func (*StringWriter) Mkdir

func (w *StringWriter) Mkdir(path string) (err error)

func (*StringWriter) Parent

func (w *StringWriter) Parent() (err error)

func (*StringWriter) Remove

func (w *StringWriter) Remove(path string) (err error)
func (w *StringWriter) Symlink(path string, a fs.FileAttrs) (err error)

type TarWriter

type TarWriter struct {
	// contains filtered or unexported fields
}

A mapping file system writer that secures root directory boundaries. Derived from umoci's tar_extract.go to allow separate source/dest interfaces and filter archive contents on extraction

func NewTarWriter

func NewTarWriter(writer io.Writer) (w *TarWriter)

func (*TarWriter) Close

func (w *TarWriter) Close() error

func (*TarWriter) Device

func (w *TarWriter) Device(path string, a fs.DeviceAttrs) (err error)

func (*TarWriter) Dir

func (w *TarWriter) Dir(path, base string, a fs.FileAttrs) (err error)

func (*TarWriter) Fifo

func (w *TarWriter) Fifo(path string, a fs.DeviceAttrs) (err error)

func (*TarWriter) File

func (w *TarWriter) File(path string, src fs.FileSource) (r fs.Source, err error)

func (*TarWriter) Lazy

func (w *TarWriter) Lazy(path, name string, src fs.LazySource, written map[fs.Source]string) (err error)
func (w *TarWriter) Link(path, target string) (err error)
func (w *TarWriter) LowerLink(path, target string, a *fs.NodeAttrs) error

func (*TarWriter) LowerNode

func (w *TarWriter) LowerNode(path, name string, a *fs.NodeAttrs) error

func (*TarWriter) Mkdir

func (w *TarWriter) Mkdir(path string) (err error)

func (*TarWriter) Parent

func (w *TarWriter) Parent() error

func (*TarWriter) Remove

func (w *TarWriter) Remove(path string) (err error)
func (w *TarWriter) Symlink(path string, a fs.FileAttrs) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL