rootpath

package
v0.0.0-...-049616f Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KetosChrootToImg  bool
	KetosChrootDir    string
	KetosChrootImgTag string
)

Functions

func ExpandPath

func ExpandPath(path string, ro bool) (string, error)

ExpandPath expand the path to fake rootfs

Types

type OverlayFS

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

OverlayFS presents an object to parse path to the right layer path

func NewDefaultOverlayFS

func NewDefaultOverlayFS() *OverlayFS

func NewOverlayFS

func NewOverlayFS(layers ...string) (*OverlayFS, error)

NewOverlayFS generate a new OverlayFS object

func NewOverlayFSFromEnv

func NewOverlayFSFromEnv() (*OverlayFS, error)

NewOverlayFSFromEnv generate OverlayFS instance from environment variable KETOS_ROOTPATH_LAYERS, default value is "/:/_ketos"

func NewSimpleOverlayFS

func NewSimpleOverlayFS(layers ...string) *OverlayFS

func (*OverlayFS) CopyForWriting

func (r *OverlayFS) CopyForWriting(path string) (string, error)

CopyForWriting copy the lower layer file to top layer for writting

func (*OverlayFS) ExpandPath

func (r *OverlayFS) ExpandPath(path string) (string, error)

Expand expand the path to the right layer path

func (*OverlayFS) IsTopLayer

func (r *OverlayFS) IsTopLayer(path string) bool

IsTopLayer check if the file path is in top layer

func (*OverlayFS) ShrinkPath

func (r *OverlayFS) ShrinkPath(expandedPath string) (string, error)

ShrinkPath shrink the expanded path to the fake rootfs path

func (*OverlayFS) WipeFile

func (r *OverlayFS) WipeFile(path string) error

WipeFile wipe a regular file on top layer

func (*OverlayFS) WipeFolder

func (r *OverlayFS) WipeFolder(path string) error

WipeFolder wipe a folder on top layer

Jump to

Keyboard shortcuts

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