Versions in this module Expand all Collapse all v0 v0.40.1 Nov 13, 2026 v0.40.0 Nov 13, 2026 Changes in this version + const FSLibraryName + const FindLibraryName + const GlobLibraryName + const GrepLibraryName + const OSLibraryName + const OSPathLibraryName + const PathlibLibraryName + const SedLibraryName + const ShutilLibraryName + const TarfileLibraryName + const TempfileLibraryName + const ZipfileLibraryName + var ErrPathNotAllowed = fssecurity.ErrPathNotAllowed + var ErrSearchNotFound = errors.New("search text not found") + var ErrSearchNotUnique = errors.New("search text matched multiple times") + func EditFile(ctx context.Context, path, search, replace string) (int, error) + func Find(ctx context.Context, root string, opts FindOptions) ([]string, error) + func NewFindLibrary(config fssecurity.Config) *object.Library + func NewGlobLibrary(config fssecurity.Config) *object.Library + func NewGrepLibrary(config fssecurity.Config) *object.Library + func NewOSLibrary(config fssecurity.Config) (*object.Library, *object.Library) + func NewPathlibLibrary(config fssecurity.Config) *object.Library + func NewSedLibrary(config fssecurity.Config) *object.Library + func NewShutilLibrary(config fssecurity.Config) *object.Library + func NewTarfileLibrary(config fssecurity.Config) *object.Library + func NewTempfileLibrary(config fssecurity.Config) *object.Library + func NewZipfileLibrary(config fssecurity.Config) *object.Library + func RegisterAll(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterFS(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterFind(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterGlob(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterGrep(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterOS(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterPathlib(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterSed(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterShutil(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterTarfile(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterTempfile(registrar object.LibraryRegistrar, allowedPaths []string) + func RegisterZipfile(registrar object.LibraryRegistrar, allowedPaths []string) + func SedReplace(ctx context.Context, old, replacement, path string, opts SedOptions) (int64, error) + func SedReplacePattern(ctx context.Context, pattern, replacement, path string, opts SedOptions) (int64, error) + type ExtractMatch struct + File string + Groups []string + Line int + Text string + func SedExtract(ctx context.Context, pattern, path string, opts SedOptions) ([]ExtractMatch, error) + type FindEntry struct + FilePerm int + Hash uint64 + IsDir bool + LinkTarget string + Mtime time.Time + Path string + Size int64 + func FindEntries(ctx context.Context, root string, opts FindOptions) ([]FindEntry, error) + type FindOptions struct + AllowedPaths []string + FollowLinks bool + IncludeHash bool + IncludeHidden bool + IncludeMetadata bool + IncludeSymlinks bool + MaxDepth int + MtimeMax *float64 + MtimeMin *float64 + Name string + Recursive *bool + SizeMax *int64 + SizeMin *int64 + Type string + type GlobLibraryInstance struct + type GrepMatch struct + File string + Line int + Text string + func Grep(ctx context.Context, needle, path string, opts GrepOptions) ([]GrepMatch, error) + type GrepOptions struct + AllowedPaths []string + FollowLinks bool + Glob string + IgnoreCase bool + Literal bool + MaxSize int64 + Recursive bool + type PathlibLibraryInstance struct + PathClass *object.Class + type SedOptions struct + AllowedPaths []string + FollowLinks bool + Glob string + IgnoreCase bool + MaxSize int64 + Recursive bool