file

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPEC pathType = "spec"
	DATA pathType = "data"

	ETC       pathType = "etc"
	CONFIG    pathType = "config"
	CODE      pathType = "code"
	RUNTIME   pathType = "runtime"
	TMPDIR    pathType = "tmp"
	WORKSPACE pathType = "workspace"
)

Variables

View Source
var (
	PathsExists    = errors.New("container paths exists")
	PathsNotExists = errors.New("container paths not exists")
)
View Source
var (
	UnknownPathType = errors.New("unknown path type")
)

Functions

This section is empty.

Types

type ContainerPaths

type ContainerPaths struct {
	PathName string

	RunnerDataPath    string
	RunnerSpecPath    string
	RunnerTmpPath     string
	CodeWorkspacePath string

	SpecConfigPath  string
	DataConfigPath  string
	DataCodePath    string
	DataRuntimePath string
}

type ContainerPathsMap

type ContainerPathsMap struct {
	Map map[string]*ContainerPaths
	// contains filtered or unexported fields
}

func InitContainerPathsMap

func InitContainerPathsMap() *ContainerPathsMap

TODO: Need to get container list from runc in non-container environment.

type MountManager

type MountManager struct {
	MountInfo []*mount.Info
	// contains filtered or unexported fields
}

MountManager

func NewMountManager

func NewMountManager(c *PathConfig, unloadCh chan string, clearCh chan string) *MountManager

NewMountManager

func (*MountManager) BindMount

func (m *MountManager) BindMount(pairs []*MountPair, atomic bool) error

func (*MountManager) FindDevice

func (d *MountManager) FindDevice(path string) (*mount.Info, error)

FindDevice

func (*MountManager) MakeShared

func (m *MountManager) MakeShared(path string) error

func (*MountManager) ParseMounted

func (m *MountManager) ParseMounted(paths map[pathType]string) (mountedPaths []string, err error)

func (*MountManager) Unmount

func (m *MountManager) Unmount(path []string, ignoreError bool) error

func (*MountManager) UnmountAllByPathName

func (m *MountManager) UnmountAllByPathName(name string) error

type MountManagerInterface

type MountManagerInterface interface {
	FindDevice(path string) (*mount.Info, error)
	MakeShared(path string) error
	BindMount(pairs []*MountPair, atomic bool) error
	Unmount(path []string, ignoreError bool) error
	UnmountAllByPathName(name string) error
}

MountManagerInterface

type MountPair

type MountPair struct {
	Source string
	Target string
}

type PathConfig

type PathConfig struct {
	RunningMode       string
	RunnerDataPath    string
	RunnerSpecPath    string
	RunnerTmpPath     string
	CodeWorkspacePath string
	EtcPath           string
	CodePath          string
	ConfPath          string
	RuntimePath       string
}

func (*PathConfig) GetPathByName

func (c *PathConfig) GetPathByName(t pathType, n string) (path string, err error)

func (*PathConfig) GetPathMapByName

func (c *PathConfig) GetPathMapByName(n string) (pathMap map[pathType]string)

type PathManager

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

PathManager

func NewPathManager

func NewPathManager(c *PathConfig, unloadCh chan string, clearCh chan string) *PathManager

NewPathManager

func (*PathManager) GeneratePaths

func (m *PathManager) GeneratePaths(id string) (cp *ContainerPaths, err error)

func (*PathManager) GetContainerID

func (m *PathManager) GetContainerID(pName string) (cName string, err error)

func (*PathManager) GetPaths

func (m *PathManager) GetPaths(id string) (cp *ContainerPaths, err error)

func (*PathManager) OutdatePaths

func (m *PathManager) OutdatePaths(id string) error

func (*PathManager) OutdatePathsByName

func (m *PathManager) OutdatePathsByName(pathName string) error

func (*PathManager) RemoveByPathName

func (m *PathManager) RemoveByPathName(name string) error

type PathManagerInterface

type PathManagerInterface interface {
	GeneratePaths(id string) (cp *ContainerPaths, err error)
	GetPaths(id string) (cp *ContainerPaths, err error)
	OutdatePaths(id string) error
	OutdatePathsByName(pathName string) error
	RemoveByPathName(name string) error
	GetContainerID(pName string) (cName string, err error)
}

PathManagerInterface

Jump to

Keyboard shortcuts

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