api

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERRNOTFOUND = errors.New("not found")
View Source
var LogDir string = "/var/run/imageapi/logs"
View Source
var LogStringToLL = map[string]logrus.Level{
	"PANIC": logrus.PanicLevel,
	"FATAL": logrus.FatalLevel,
	"ERROR": logrus.ErrorLevel,
	"WARN":  logrus.WarnLevel,
	"INFO":  logrus.InfoLevel,
	"DEBUG": logrus.DebugLevel,
	"TRACE": logrus.TraceLevel,
}
View Source
var MountDir string = "/var/run/imageapi/mounts"

Functions

func ForkInit added in v0.1.5

func ForkInit()

func GarbageCollect added in v0.1.5

func GarbageCollect()

func ListMounts

func ListMounts() (ret []*models.Mount)

List all mounts

func Mount

func Mount(mnt *models.Mount) (ret *models.Mount, err error)

Mount based on a generic specification

func MountGetMountpoint

func MountGetMountpoint(mnt *models.Mount) (mntpt string, err error)

func MountRefAdd

func MountRefAdd(mnt *models.Mount, n int64)

func Unmount

func Unmount(mnt *models.Mount) (ret *models.Mount, err error)

Unmount based on a generic specification

Types

type ContainersType

type ContainersType struct {
	// contains filtered or unexported fields
}
var Containers *ContainersType

func (*ContainersType) Create

func (c *ContainersType) Create(ctn *models.Container) (r *models.Container, err error)

func (*ContainersType) Delete

func (c *ContainersType) Delete(id models.ID) (ret *models.Container, err error)

func (*ContainersType) Get

func (c *ContainersType) Get(id models.ID) (*models.Container, error)

func (*ContainersType) Init

func (c *ContainersType) Init()

func (*ContainersType) List

func (c *ContainersType) List() (r []*models.Container)

func (*ContainersType) NameGetID

func (c *ContainersType) NameGetID(name models.Name) models.ID

NameGetID will return the ID for a given name This is used to implement the `byname` calls If the name is not found, it will return -1

func (*ContainersType) SetState

func (c *ContainersType) SetState(id models.ID, state models.ContainerState) (err error)

type MountsOverlayType

type MountsOverlayType struct {
	// contains filtered or unexported fields
}
var MountsOverlay *MountsOverlayType

func (*MountsOverlayType) Collect

func (m *MountsOverlayType) Collect()

Collect will run garbage collection on any RBDs with ref == 0

func (*MountsOverlayType) Get

func (*MountsOverlayType) Init

func (m *MountsOverlayType) Init()

func (*MountsOverlayType) List

func (m *MountsOverlayType) List() (r []*models.MountOverlay)

func (*MountsOverlayType) Mount

func (m *MountsOverlayType) Mount(mnt *models.MountOverlay) (r *models.MountOverlay, err error)

func (*MountsOverlayType) RefAdd

func (m *MountsOverlayType) RefAdd(id models.ID, n int64)

func (*MountsOverlayType) Unmount

func (m *MountsOverlayType) Unmount(id models.ID) (mnt *models.MountOverlay, err error)

type MountsRBDType

type MountsRBDType struct {
	// contains filtered or unexported fields
}
var MountsRbd *MountsRBDType

func (*MountsRBDType) Collect

func (m *MountsRBDType) Collect()

Collect will run garbage collection on any RBDs with ref == 0

func (*MountsRBDType) Get

func (m *MountsRBDType) Get(id models.ID) (mnt *models.MountRbd, err error)

func (*MountsRBDType) Init

func (m *MountsRBDType) Init()

func (*MountsRBDType) List

func (m *MountsRBDType) List() (mnts []*models.MountRbd)

func (*MountsRBDType) Mount

func (m *MountsRBDType) Mount(mnt *models.MountRbd) (ret *models.MountRbd, err error)

func (*MountsRBDType) RefAdd

func (m *MountsRBDType) RefAdd(id models.ID, n int64)

func (*MountsRBDType) Unmount

func (m *MountsRBDType) Unmount(id models.ID) (ret *models.MountRbd, err error)

type RbdsType

type RbdsType struct {
	// contains filtered or unexported fields
}
var Rbds *RbdsType

func (*RbdsType) Collect

func (r *RbdsType) Collect()

Collect will run garbage collection on any RBDs with ref == 0

func (*RbdsType) Get

func (r *RbdsType) Get(id models.ID) (m *models.Rbd, err error)

func (*RbdsType) Init

func (r *RbdsType) Init()

func (*RbdsType) List

func (r *RbdsType) List() (result []*models.Rbd)

func (*RbdsType) Map

func (r *RbdsType) Map(rbd *models.Rbd) (m *models.Rbd, err error)

func (*RbdsType) RefAdd

func (r *RbdsType) RefAdd(id models.ID, n int64)

add/subtract from ref counter silently fails if id doesn't exist

func (*RbdsType) Unmap

func (r *RbdsType) Unmap(id models.ID) (m *models.Rbd, err error)

Jump to

Keyboard shortcuts

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