sys

package
v1.63.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dump = ".fox_dump"
)

Variables

View Source
var (
	ErrorInvalidOffset = errors.New("invalid offset")
)
View Source
var (
	Log *logger // global logger
)

Functions

func DumpErr

func DumpErr(err any, stack any)

func Error

func Error(v ...any)

func Exists

func Exists(name string) bool

func Exit

func Exit(v ...any)

func IsPiped

func IsPiped(file File) bool

func Panic

func Panic(v ...any)

func Persist

func Persist(name string) string

func Setup

func Setup()

func Shell

func Shell()

Types

type File

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.ReaderFrom
	io.Seeker
	io.Writer
	io.WriterAt
	io.WriterTo
	io.StringWriter

	Name() string
	Stat() (fs.FileInfo, error)
	Truncate(size int64) error
}

func DumpStr

func DumpStr(data string) File

func Exec

func Exec(cmds []string) File

func Mapped

func Mapped(name string) File

func OpenFile

func OpenFile(name string) File

func Stderr

func Stderr() File

func Stdin

func Stdin() File

func Stdout

func Stdout() File

func TempFile

func TempFile(name string) File

type FileData

type FileData struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFileData

func NewFileData(name string) *FileData

func (*FileData) Bytes

func (fd *FileData) Bytes() []byte

func (*FileData) Close

func (fd *FileData) Close() error

func (*FileData) Name

func (fd *FileData) Name() string

func (*FileData) Read

func (fd *FileData) Read(b []byte) (n int, err error)

func (*FileData) ReadAt

func (fd *FileData) ReadAt(b []byte, off int64) (n int, err error)

func (*FileData) ReadFrom

func (fd *FileData) ReadFrom(r io.Reader) (n int64, err error)

func (*FileData) Seek

func (fd *FileData) Seek(offset int64, whence int) (int64, error)

func (*FileData) Stat

func (fd *FileData) Stat() (fs.FileInfo, error)

func (*FileData) Truncate

func (fd *FileData) Truncate(size int64) error

func (*FileData) Watch

func (fd *FileData) Watch(ch chan fsnotify.Event)

func (*FileData) Write

func (fd *FileData) Write(b []byte) (n int, err error)

func (*FileData) WriteAt

func (fd *FileData) WriteAt(b []byte, off int64) (n int, err error)

func (*FileData) WriteString

func (fd *FileData) WriteString(s string) (n int, err error)

func (*FileData) WriteTo

func (fd *FileData) WriteTo(w io.Writer) (n int64, err error)

type FileInfo

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

func NewFileInfo

func NewFileInfo(fd *FileData) *FileInfo

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() fs.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() any

Jump to

Keyboard shortcuts

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