shutils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsufficientArgsError

func InsufficientArgsError(cmd string, exp, got int) error

func NopExec

func NopExec(context.Context, []string) error

func NopReadDir

func NopReadDir(context.Context, string) ([]os.FileInfo, error)

func NopStat

func NopStat(context.Context, string, bool) (os.FileInfo, error)

func RestrictedExec

func RestrictedExec(allowedCmds ...string) interp.ExecHandlerFunc

func RestrictedOpen

func RestrictedOpen(allowedPrefixes ...string) interp.OpenHandlerFunc

func RestrictedReadDir

func RestrictedReadDir(allowedPrefixes ...string) interp.ReadDirHandlerFunc

func RestrictedStat

func RestrictedStat(allowedPrefixes ...string) interp.StatHandlerFunc

Types

type ExecFunc

type ExecFunc func(hc interp.HandlerContext, name string, args []string) error

type ExecFuncs

type ExecFuncs map[string]ExecFunc

func (ExecFuncs) ExecHandler

func (ef ExecFuncs) ExecHandler(fallback interp.ExecHandlerFunc) interp.ExecHandlerFunc

ExecHandler returns a new ExecHandlerFunc that falls back to fallback if the command cannot be found in the map. If fallback is nil, the default handler is used.

type NopRWC

type NopRWC struct{}

func (NopRWC) Close

func (NopRWC) Close() error

func (NopRWC) Read

func (NopRWC) Read([]byte) (int, error)

func (NopRWC) Write

func (NopRWC) Write(b []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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