utils

package
v0.0.0-...-4fa2157 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWithPool

func CopyWithPool(dst io.Writer, src io.Reader) (written int64, err error)

func FixTmpDir

func FixTmpDir(dir string, uid, gid int) error

Types

type FileUtil

type FileUtil interface {
	ReadDirectory(dirPath string) ([]os.DirEntry, error)
	Stat(name string) (os.FileInfo, error)
	IsNotExist(err error) bool
}

func NewFileUtil

func NewFileUtil() FileUtil

type MockDirEntry

type MockDirEntry struct {
	// contains filtered or unexported fields
}

func NewMockDirEntry

func NewMockDirEntry(name string, isDir bool) MockDirEntry

func (MockDirEntry) Info

func (m MockDirEntry) Info() (os.FileInfo, error)

func (MockDirEntry) IsDir

func (m MockDirEntry) IsDir() bool

func (MockDirEntry) Name

func (m MockDirEntry) Name() string

func (MockDirEntry) Type

func (m MockDirEntry) Type() os.FileMode

type MockFileInfo

type MockFileInfo struct {
	mock.Mock
}

func NewMockFileInfo

func NewMockFileInfo() *MockFileInfo

func (*MockFileInfo) IsDir

func (m *MockFileInfo) IsDir() bool

func (*MockFileInfo) ModTime

func (m *MockFileInfo) ModTime() time.Time

func (*MockFileInfo) Mode

func (m *MockFileInfo) Mode() os.FileMode

func (*MockFileInfo) Name

func (m *MockFileInfo) Name() string

func (*MockFileInfo) Size

func (m *MockFileInfo) Size() int64

func (*MockFileInfo) Sys

func (m *MockFileInfo) Sys() interface{}

type MockFileUtil

type MockFileUtil struct {
	mock.Mock
}

func NewMockFileUtil

func NewMockFileUtil(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockFileUtil

func (*MockFileUtil) IsNotExist

func (_m *MockFileUtil) IsNotExist(err error) bool

func (*MockFileUtil) ReadDirectory

func (_m *MockFileUtil) ReadDirectory(dirPath string) ([]fs.DirEntry, error)

func (*MockFileUtil) Stat

func (_m *MockFileUtil) Stat(name string) (fs.FileInfo, error)

type TimedReader

type TimedReader struct {
	Reader        io.Reader
	Name          string
	Ctx           context.Context
	TotalDuration time.Duration
}

func (*TimedReader) Read

func (tr *TimedReader) Read(p []byte) (n int, err error)

type TimedWriter

type TimedWriter struct {
	Writer        io.Writer
	Name          string
	Ctx           context.Context
	TotalDuration time.Duration
}

func (*TimedWriter) Write

func (tw *TimedWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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