makefs

package
v0.0.0-...-38146a2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	fs.FS
	// contains filtered or unexported fields
}

func MountOpener

func MountOpener(fsys fs.FS, name string, opener Opener) *FS

func New

func New(fsys fs.FS, pattern string, opener Opener) *FS

func (*FS) Open

func (m *FS) Open(name string) (fs.File, error)

func (*FS) OpenFile

func (m *FS) OpenFile(name string, flag int, perm fs.FileMode) (fs.File, error)

func (*FS) Stat

func (m *FS) Stat(name string) (fi fs.FileInfo, err error)

type MakeFunc

type MakeFunc func(files []OpenFile) ([]byte, error)

MakeFunc takes open Files and does some operation returning bytes.

type OpenFile

type OpenFile struct {
	Path string
	File fs.File
}

type Opener

type Opener func(name string) fs.File

func MakeOpener

func MakeOpener(fsys fs.FS, fn MakeFunc, deps ...string) Opener

MakeOpener returns an Opener that performs a MakeFunc using optional dependency filepaths. The idea is to replicate Make task semantics.

func TransformFrom

func TransformFrom(fsys fs.FS, name string, xform transform.Transformer) Opener

TransformFrom returns an Opener that performs a transform on the given source file. It is a more specific API for MakeOpener focusing on a single file and the transform.Transformer interface.

Jump to

Keyboard shortcuts

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