image

package
v3.1.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package image provides underlying data types for Singularity image formats. Additionally, all image types will satisfy the ImageFormat{} interface. This interface will expose all things necessary to use a Singularity image, whether through OCI or directly.

type ImageFormat interface {
    Root() *spec.Root - Root() returns the OCI compliant root of the
                        Image. This function may preform some action,
                        such as extracting the filesystem to a dir.

}

Index

Constants

View Source
const EXT3 = 2

EXT3 defines constant for ext3 format

View Source
const SANDBOX = 3

SANDBOX defines constant for directory format

View Source
const SIF = 4

SIF defines constant for sif format

View Source
const SQUASHFS = 1

SQUASHFS defines constant for squashfs format

Variables

This section is empty.

Functions

func CheckExt3Header

func CheckExt3Header(b []byte) (uint64, error)

CheckExt3Header checks if byte content contains a valid ext3 header and returns offset where ext3 partition begin

func CheckSquashfsHeader

func CheckSquashfsHeader(b []byte) (uint64, error)

CheckSquashfsHeader checks if byte content contains a valid squashfs header and returns offset where squashfs partition start

func ResolvePath

func ResolvePath(path string) (string, error)

ResolvePath returns a resolved absolute path

Types

type Image

type Image struct {
	Path     string   `json:"path"`
	Name     string   `json:"name"`
	Type     int      `json:"type"`
	File     *os.File `json:"-"`
	Fd       uintptr  `json:"fd"`
	Source   string   `json:"source"`
	Offset   uint64   `json:"offset"`
	Size     uint64   `json:"size"`
	Writable bool     `json:"writable"`
	RootFS   bool     `json:"rootFS"`
}

Image describes an image object

func Init

func Init(path string, writable bool) (*Image, error)

Init initilizes an image object based on given path

func (*Image) AuthorizedGroup

func (i *Image) AuthorizedGroup(groups []string) (bool, error)

AuthorizedGroup checks if image is owned by group supplied in groups list

func (*Image) AuthorizedOwner

func (i *Image) AuthorizedOwner(owners []string) (bool, error)

AuthorizedOwner checks if image is owned by user supplied in users list

func (*Image) AuthorizedPath

func (i *Image) AuthorizedPath(paths []string) (bool, error)

AuthorizedPath checks if image is in a path supplied in paths

Jump to

Keyboard shortcuts

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