host

package
v0.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndividualFuncChmod

type IndividualFuncChmod struct {
	Name        string
	FileModeode os.FileMode
	ReturnError error
}

type IndividualFuncChown

type IndividualFuncChown struct {
	Name        string
	Uid         int
	Gid         int
	ReturnError error
}

type IndividualFuncLookup

type IndividualFuncLookup struct {
	Username    string
	ReturnUser  *user.User
	ReturnError error
}

type IndividualFuncLookupGroup

type IndividualFuncLookupGroup struct {
	Name        string
	ReturnGroup *user.Group
	ReturnError error
}

type IndividualFuncLstat

type IndividualFuncLstat struct {
	Name           string
	ReturnFileInfo os.FileInfo
	ReturnError    error
}

type IndividualFuncReadFile

type IndividualFuncReadFile struct {
	Name        string
	ReturnBytes []byte
	ReturnError error
}

type IndividualFuncRemove

type IndividualFuncRemove struct {
	Name        string
	ReturnError error
}

type IndividualFuncRun

type IndividualFuncRun struct {
	Cmd              host.Cmd
	ReturnWaitStatus host.WaitStatus
	ReturnStdout     string
	ReturnStderr     string
	ReturnError      error
}

type IndividualFuncWriteFile

type IndividualFuncWriteFile struct {
	Name        string
	Data        []byte
	Perm        os.FileMode
	ReturnError error
}

type Test

type Test struct {
	T                           *testing.T
	ExpectedIndividualFuncCalls []IndividualFuncCall
}

Test aids testing by enabling mocking of host functions.

func (Test) Chmod

func (t Test) Chmod(ctx context.Context, name string, mode os.FileMode) error

func (Test) Chown

func (t Test) Chown(ctx context.Context, name string, uid, gid int) error

func (Test) Lookup

func (t Test) Lookup(ctx context.Context, username string) (*user.User, error)

func (Test) LookupGroup

func (t Test) LookupGroup(ctx context.Context, name string) (*user.Group, error)

func (Test) Lstat

func (t Test) Lstat(ctx context.Context, name string) (os.FileInfo, error)

func (Test) ReadFile

func (t Test) ReadFile(ctx context.Context, name string) ([]byte, error)

func (Test) Remove

func (t Test) Remove(ctx context.Context, name string) error

func (Test) Run

func (t Test) Run(ctx context.Context, cmd host.Cmd) (host.WaitStatus, string, string, error)

func (Test) String

func (t Test) String() string

func (Test) WriteFile

func (t Test) WriteFile(ctx context.Context, name string, data []byte, perm os.FileMode) error

Jump to

Keyboard shortcuts

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