utils

package
v0.0.0-...-e08062c Latest Latest
Warning

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

Go to latest
Published: May 29, 2017 License: GPL-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ChunkSize = 128 * 1024
)

Variables

This section is empty.

Functions

func DataSha256sum

func DataSha256sum(data []byte) string

func FileSha256sum

func FileSha256sum(fsb afero.Fs, filepath string) (string, error)

func MergeErrorList

func MergeErrorList(errorList []error) error

Types

type CmdLine

type CmdLine struct {
}

func (*CmdLine) Execute

func (cl *CmdLine) Execute(cmdline string) ([]byte, error)

type CmdLineExecuter

type CmdLineExecuter interface {
	Execute(cmdline string) ([]byte, error)
}

type FileSystem

type FileSystem struct {
	CmdLineExecuter
}

func (*FileSystem) Format

func (fs *FileSystem) Format(targetDevice string, fsType string, formatOptions string) error

func (*FileSystem) Mount

func (fs *FileSystem) Mount(targetDevice string, mountPath string, fsType string, mountOptions string) error

func (*FileSystem) TempDir

func (fs *FileSystem) TempDir(fsb afero.Fs, prefix string) (string, error)

func (*FileSystem) Umount

func (fs *FileSystem) Umount(mountPath string) error

type FileSystemHelper

type FileSystemHelper interface {
	Format(targetDevice string, fsType string, formatOptions string) error
	Mount(targetDevice string, mountPath string, fsType string, mountOptions string) error
	TempDir(fsb afero.Fs, prefix string) (string, error)
	Umount(mountPath string) error
}

type MtdUtils

type MtdUtils interface {
	MtdIsNAND(devicepath string) (bool, error)
	GetTargetDeviceFromMtdName(fsBackend afero.Fs, mtdname string) (string, error)
}

type MtdUtilsImpl

type MtdUtilsImpl struct {
}

func (MtdUtilsImpl) GetTargetDeviceFromMtdName

func (m MtdUtilsImpl) GetTargetDeviceFromMtdName(fsBackend afero.Fs, mtdname string) (string, error)

func (MtdUtilsImpl) MtdIsNAND

func (m MtdUtilsImpl) MtdIsNAND(devicepath string) (bool, error)

type Permissions

type Permissions interface {
	ApplyChmod(fsb afero.Fs, filepath string, modestr string) error
	ApplyChown(filepath string, uid interface{}, gid interface{}) error
}

type PermissionsDefaultImpl

type PermissionsDefaultImpl struct {
}

func (*PermissionsDefaultImpl) ApplyChmod

func (pdi *PermissionsDefaultImpl) ApplyChmod(fsb afero.Fs, filepath string, modestr string) error

func (*PermissionsDefaultImpl) ApplyChown

func (pdi *PermissionsDefaultImpl) ApplyChown(filepath string, uid interface{}, gid interface{}) error

FIXME: this cannot be tested yet with unit tests because requires mock for: os.Chown, os.Lchown, os.Lstat, user.Lookup and user.LookupGroup. Since we can't change ownership on a real filesystem, this must be tested through integration.

type UbifsUtils

type UbifsUtils interface {
	GetTargetDeviceFromUbiVolumeName(fsBackend afero.Fs, volume string) (string, error)
}

type UbifsUtilsImpl

type UbifsUtilsImpl struct {
	CmdLineExecuter
}

func (*UbifsUtilsImpl) GetTargetDeviceFromUbiVolumeName

func (uui *UbifsUtilsImpl) GetTargetDeviceFromUbiVolumeName(fsBackend afero.Fs, volume string) (string, error)

Jump to

Keyboard shortcuts

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