Documentation
¶
Index ¶
- Constants
- Variables
- func Call(ctx context.Context, callers ...Caller) (err error)
- func Cat(path string) string
- func FileNotExist(path string) bool
- func IOCopy(ctx context.Context, w io.Writer, r io.Reader) (err error)
- func IOR(ctx context.Context, r io.Reader) io.Reader
- func IORE(r io.Reader, err error) io.ReadCloser
- func IOW(ctx context.Context, w io.Writer) io.Writer
- func IOWriteFile(ctx context.Context, src io.Reader, dstPath string, perm fs.FileMode) (err error)
- func IsDir(path string) bool
- func IsDirEmpty(path string) bool
- func IsFile(path string) bool
- func IsForkTag(tag string) bool
- func IsSignaled(err error) bool
- func IsSubPath(basepath, targpath string) bool
- func IsSymlink(path string) bool
- func MessageRecive(ctx context.Context, handleMessage func(ctx context.Context, msg string)) io.WriteCloser
- func ParallelCall(ctx context.Context, callers ...Caller) error
- func RandText(n int) (s string)
- func ReadDirNames(path string, n int) (files []string, err error)
- func ReadDirs(path string, n int) (files []fs.DirEntry, err error)
- func RealPath(path string) (string, error)
- func SetChroot(c *exec.Cmd, root string)
- func SetCredential(c *exec.Cmd, uid, gid uint32)
- func SetNewNS(c *exec.Cmd)
- func SetPdeathsig(c *exec.Cmd, sig syscall.Signal)
- func SkipErrCall(ctx context.Context, callers ...Caller)
- func Symlink(srcPath, dstPath string) func(ctx context.Context) (err error)
- func TarExtract(ctx context.Context, src io.Reader, walk TarWalkFunc, decoder ...TarDecoder) (err error)
- func UserLookup(userOrId, groupOrId string) (uid, gid uint32, err error)
- type Caller
- func Bind(srcPath, rootDir string, recursive ...bool) Caller
- func Chdir(target string) Caller
- func Chmod(path string, perm fs.FileMode, recursive ...bool) Caller
- func Chown(path string, uid, gid uint32, recursive ...bool) Caller
- func Chroot(target string) Caller
- func Chtimes(name string, atime, mtime, ctime time.Time) Caller
- func FileWrite[T ~string | ~[]byte](path string, data T, perm os.FileMode, overwrite ...bool) Caller
- func FileWriteCopy[T ~string | ~[]byte](writeTo, copyTo string, data T, perm os.FileMode) Caller
- func Fork(name string, args []string, env []string, tag string) Caller
- func Mkdir(path string, perm fs.FileMode, recursives ...bool) Caller
- func Mkdirs(path string) Caller
- func Mount(device, target, mType, options string, force ...bool) Caller
- func Unmount(target string, recursives ...bool) Caller
- type Env
- type TarDecoder
- type TarWalkFunc
Constants ¶
View Source
const ( SIGKILL = syscall.SIGKILL SIGINT = syscall.SIGINT )
Variables ¶
View Source
var B32 = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)
Functions ¶
func FileNotExist ¶
func IOWriteFile ¶ added in v0.0.2
func IsDirEmpty ¶
func IsSignaled ¶ added in v0.0.9
func MessageRecive ¶ added in v0.0.8
func SetCredential ¶
func TarExtract ¶ added in v0.0.2
func TarExtract(ctx context.Context, src io.Reader, walk TarWalkFunc, decoder ...TarDecoder) (err error)
func UserLookup ¶
Types ¶
type Caller ¶
func FileWrite ¶
func FileWrite[T ~string | ~[]byte](path string, data T, perm os.FileMode, overwrite ...bool) Caller
fileWrite 写入文件,存在则跳过
func FileWriteCopy ¶
fileWriteCopy 先写入文件到 writeTo,存在则跳过写入,再复制到 copyTo,存在则跳过
type TarDecoder ¶ added in v0.0.2
type TarDecoder func(io.Reader) (io.ReadCloser, error)
func (TarDecoder) Decode ¶ added in v0.0.2
func (d TarDecoder) Decode(r io.Reader) io.ReadCloser
Click to show internal directories.
Click to hide internal directories.