filesystem

package
v0.0.0-...-c1a64fe Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSOption

type FSOption func(fp *FSProvider) error

func WithDefaults

func WithDefaults() FSOption

WithDefaults adds the JPG, JPEG and PNG extensions and sets the working directory to the CWD.

func WithExtensions

func WithExtensions(ext ...string) FSOption

WithExtensions adds supported extensions. Note that for an image extension to be decode-able it must be imported (for side effects) by a built package. The following extensions are supported by default, but must be enabled individually:

  • PNG
  • JPG
  • GIF

func WithFilter

func WithFilter(r regexp.Regexp) FSOption

WithFilter adds a regex filter to the file search. Files that match *any* provided filter will be used.

func WithWorkingDir

func WithWorkingDir(path string) FSOption

WithWorkingDir sets the root directory to search in

type FSProvider

type FSProvider struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...FSOption) (FSProvider, error)

New returns a provider.Provider that gets provider.AlbumInfo from a local directory. Images in that directory with names of the form "Artist Name - Album Name" will be converted into the corresponding information structure. If WithWorkingDir isn't provided, the current working directory will be used.

func (FSProvider) Fetch

func (fp FSProvider) Fetch(n int) ([]provider.AlbumInfo, error)

Jump to

Keyboard shortcuts

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