Documentation
¶
Index ¶
- Constants
- func CopyFromFS(root, dest string, fsys Filesystem) (err error)
- func Dir() (path string)
- func FileExists(file string) bool
- func GetCreatePath() (err error)
- func InteractiveTerminal() bool
- func LoadTemplate(path, file, builtin string) (string, error)
- func NewErrNotInitialized(path string) error
- func NewMaskingFS(masked func(path string) bool, fs Filesystem) maskingFS
- func NewOsFilesystem(root string) osFilesystem
- func NewSortedSet() *sortedSet
- func NewSubFS(root string, fs Filesystem) subFS
- func NewZipFS(archive *zip.Reader) zipFS
- func RepositoriesPath() string
- type BillyFilesystem
- type ErrNotInitialized
- type Filesystem
- type UnionFS
Constants ¶
const (
EmbedSchema = "embed"
)
const (
Repositories = "repositories"
)
Variables ¶
This section is empty.
Functions ¶
func CopyFromFS ¶
func CopyFromFS(root, dest string, fsys Filesystem) (err error)
CopyFromFS copies files from the `src` dir on the accessor Filesystem to local filesystem into `dest` dir. The src path uses slashes as their separator. The dest path uses OS specific separator.
func FileExists ¶
func GetCreatePath ¶
func GetCreatePath() (err error)
func InteractiveTerminal ¶
func InteractiveTerminal() bool
func LoadTemplate ¶
func NewErrNotInitialized ¶
func NewMaskingFS ¶
func NewMaskingFS(masked func(path string) bool, fs Filesystem) maskingFS
func NewOsFilesystem ¶
func NewOsFilesystem(root string) osFilesystem
func NewSortedSet ¶
func NewSortedSet() *sortedSet
func NewSubFS ¶
func NewSubFS(root string, fs Filesystem) subFS
func RepositoriesPath ¶
func RepositoriesPath() string
Types ¶
type BillyFilesystem ¶
type BillyFilesystem struct {
// contains filtered or unexported fields
}
BillyFilesystem is a template file accessor backed by a billy FS
func NewBillyFilesystem ¶
func NewBillyFilesystem(fs billy.Filesystem) BillyFilesystem
type ErrNotInitialized ¶
type ErrNotInitialized struct {
Path string
}
func (ErrNotInitialized) Error ¶
func (e ErrNotInitialized) Error() string
type Filesystem ¶
Filesystems Wrap the implementations of FS with their subtle differences into the common interface for accessing template files defined herein. os: standard for on-disk extensible template repositories. zip: embedded filesystem backed by the byte array representing zipfile. billy: go-git library's filesystem used for remote git template repos.
type UnionFS ¶
type UnionFS struct {
// contains filtered or unexported fields
}
UnionFS is an os.FS and embed.FS union fs. Files in embed.FS has the header "embed://", and files in os.FS don't have this header.