immuos

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filepath

type Filepath interface {
	Abs(path string) (string, error)
	Base(path string) string
	Ext(path string) string
	Dir(path string) string
	Walk(root string, walkFn filepath.WalkFunc) error
	FromSlash(path string) string
	Join(elem ...string) string
	Clean(path string) string
	Split(path string) (dir, file string)
}

Filepath ...

type Ioutil

type Ioutil interface {
	ReadFile(filename string) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
}

Ioutil ...

type OS

type OS interface {
	Filepath
	User
	Ioutil
	Create(name string) (*os.File, error)
	Getwd() (string, error)
	Mkdir(name string, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	Remove(name string) error
	RemoveAll(path string) error
	Rename(oldpath, newpath string) error
	Stat(name string) (os.FileInfo, error)
	Chown(name string, uid, gid int) error
	Chmod(name string, mode os.FileMode) error
	IsNotExist(err error) bool
	Open(name string) (*os.File, error)
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Executable() (string, error)
	Getpid() int
}

OS ...

type StandardFilepath

type StandardFilepath struct {
	AbsF       func(path string) (string, error)
	BaseF      func(path string) string
	ExtF       func(path string) string
	DirF       func(path string) string
	WalkF      func(root string, walkFn filepath.WalkFunc) error
	FromSlashF func(path string) string
	JoinF      func(elem ...string) string
	CleanF     func(path string) string
	SplitF     func(path string) (dir, file string)
}

StandardFilepath ...

func NewStandardFilepath

func NewStandardFilepath() *StandardFilepath

NewStandardFilepath ...

func (*StandardFilepath) Abs

func (sf *StandardFilepath) Abs(path string) (string, error)

Abs ...

func (*StandardFilepath) Base

func (sf *StandardFilepath) Base(path string) string

Base ...

func (*StandardFilepath) Clean

func (sf *StandardFilepath) Clean(path string) string

Clean ...

func (*StandardFilepath) Dir

func (sf *StandardFilepath) Dir(path string) string

Dir ...

func (*StandardFilepath) Ext

func (sf *StandardFilepath) Ext(path string) string

Ext ...

func (*StandardFilepath) FromSlash

func (sf *StandardFilepath) FromSlash(path string) string

FromSlash ...

func (*StandardFilepath) Join

func (sf *StandardFilepath) Join(elem ...string) string

Join ...

func (*StandardFilepath) Split

func (sf *StandardFilepath) Split(path string) (dir, file string)

Split ...

func (*StandardFilepath) Walk

func (sf *StandardFilepath) Walk(root string, walkFn filepath.WalkFunc) error

Walk ...

type StandardIoutil

type StandardIoutil struct {
	ReadFileF  func(filename string) ([]byte, error)
	WriteFileF func(filename string, data []byte, perm os.FileMode) error
}

StandardIoutil ...

func NewStandardIoutil

func NewStandardIoutil() *StandardIoutil

NewStandardIoutil ...

func (*StandardIoutil) ReadFile

func (sio *StandardIoutil) ReadFile(filename string) ([]byte, error)

ReadFile ...

func (*StandardIoutil) WriteFile

func (sio *StandardIoutil) WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile ...

type StandardOS

type StandardOS struct {
	*StandardFilepath
	*StandardUser
	*StandardIoutil
	CreateF     func(name string) (*os.File, error)
	GetwdF      func() (string, error)
	MkdirF      func(name string, perm os.FileMode) error
	MkdirAllF   func(path string, perm os.FileMode) error
	RemoveF     func(name string) error
	RemoveAllF  func(path string) error
	RenameF     func(oldpath, newpath string) error
	StatF       func(name string) (os.FileInfo, error)
	ChownF      func(name string, uid, gid int) error
	ChmodF      func(name string, mode os.FileMode) error
	IsNotExistF func(err error) bool
	OpenF       func(name string) (*os.File, error)
	OpenFileF   func(name string, flag int, perm os.FileMode) (*os.File, error)
	ExecutableF func() (string, error)
	GetpidF     func() int
}

StandardOS ...

func NewStandardOS

func NewStandardOS() *StandardOS

NewStandardOS ...

func (*StandardOS) Chmod

func (sos *StandardOS) Chmod(name string, mode os.FileMode) error

Chmod ...

func (*StandardOS) Chown

func (sos *StandardOS) Chown(name string, uid, gid int) error

Chown ...

func (*StandardOS) Create

func (sos *StandardOS) Create(name string) (*os.File, error)

Create ...

func (*StandardOS) Executable

func (sos *StandardOS) Executable() (string, error)

Executable ...

func (*StandardOS) Getpid

func (sos *StandardOS) Getpid() int

Getpid ...

func (*StandardOS) Getwd

func (sos *StandardOS) Getwd() (string, error)

Getwd ...

func (*StandardOS) IsNotExist

func (sos *StandardOS) IsNotExist(err error) bool

IsNotExist ...

func (*StandardOS) Mkdir

func (sos *StandardOS) Mkdir(name string, perm os.FileMode) error

Mkdir ...

func (*StandardOS) MkdirAll

func (sos *StandardOS) MkdirAll(path string, perm os.FileMode) error

MkdirAll ...

func (*StandardOS) Open

func (sos *StandardOS) Open(name string) (*os.File, error)

Open ...

func (*StandardOS) OpenFile

func (sos *StandardOS) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile ...

func (*StandardOS) Remove

func (sos *StandardOS) Remove(name string) error

Remove ...

func (*StandardOS) RemoveAll

func (sos *StandardOS) RemoveAll(path string) error

RemoveAll ...

func (*StandardOS) Rename

func (sos *StandardOS) Rename(oldpath, newpath string) error

Rename ...

func (*StandardOS) Stat

func (sos *StandardOS) Stat(name string) (os.FileInfo, error)

Stat ...

type StandardUser

type StandardUser struct {
	AddGroupF    func(name string) error
	AddUserF     func(usr string, group string) error
	LookupGroupF func(name string) (*user.Group, error)
	LookupF      func(username string) (*user.User, error)
}

StandardUser ...

func NewStandardUser

func NewStandardUser() *StandardUser

NewStandardUser ...

func (*StandardUser) AddGroup

func (su *StandardUser) AddGroup(name string) error

AddGroup ...

func (*StandardUser) AddUser

func (su *StandardUser) AddUser(usr string, group string) error

AddUser ...

func (*StandardUser) Lookup

func (su *StandardUser) Lookup(username string) (*user.User, error)

Lookup ...

func (*StandardUser) LookupGroup

func (su *StandardUser) LookupGroup(name string) (*user.Group, error)

LookupGroup ...

type User

type User interface {
	AddGroup(name string) error
	AddUser(usr string, group string) error
	LookupGroup(name string) (*user.Group, error)
	Lookup(username string) (*user.User, error)
}

User ...

Jump to

Keyboard shortcuts

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