shutils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsufficientArgsError added in v0.0.4

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 added in v0.0.5

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

func RestrictedOpen added in v0.0.5

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

func RestrictedReadDir added in v0.0.5

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

func RestrictedStat added in v0.0.5

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

Types

type ExecFunc added in v0.0.4

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