filter

package
v1.12.13 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matched

func Matched(patterns []string, fullName, dir, fname string) bool

func New

func New(fs http.FileSystem, filter FilterFunc) http.FileSystem

New creates a http.FileSystem with a (filter FilterFunc).

func Select

func Select(fs http.FileSystem, patterns ...string) http.FileSystem

Select creates a http.FileSystem with filter patterns.

Types

type DirEntry

type DirEntry interface {
	// Name returns the name of the file (or subdirectory) described by the entry.
	// This name is only the final element of the path (the base name), not the entire path.
	// For example, Name would return "hello.go" not "home/gopher/hello.go".
	Name() string

	// IsDir reports whether the entry describes a directory.
	IsDir() bool
}

type FilterFunc

type FilterFunc = func(name string, fi DirEntry) bool

Jump to

Keyboard shortcuts

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