bindataafero

package module
v0.0.0-...-9ea3a11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 3 Imported by: 0

README

go-bindata-afero

A bridge between go-bindata and Afero, converts go-bindata embedded data into a Afero Memory FS.

Usage

fs := bindataafero.MustNewBindataFs(Asset, AssetInfo, AssetDir)

You can also write assets to an existing Afero FS, see fs_test.go for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewBindataFs

func MustNewBindataFs(assetFn AssetFn, assetInfoFn AssetInfoFn, assetDirFn AssetDirFn) afero.Fs

MustNewBindataFs creates a afero.Fs using specified assets. Errors will lead to panic.

func NewBindataFs

func NewBindataFs(assetFn AssetFn, assetInfoFn AssetInfoFn, assetDirFn AssetDirFn) (afero.Fs, error)

NewBindataFs creates a afero.Fs using specified assets. Errors may be returned.

func WriteAssetsInDirectory

func WriteAssetsInDirectory(fs afero.Fs, assetFn AssetFn, assetInfoFn AssetInfoFn, assetDirFn AssetDirFn, targetBaseDir, srcBaseDir, dirPath string) error

WriteAssetsInDirectory writes assets in `dirPath` to a afero.Fs directory `targetBaseDir`.

Types

type AssetDirFn

type AssetDirFn func(name string) ([]string, error)

type AssetFn

type AssetFn func(name string) ([]byte, error)

type AssetInfoFn

type AssetInfoFn func(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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