fsutils

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSON string = ".json"
	YAML string = ".yml"
)

Variables

This section is empty.

Functions

func CopyFileContent

func CopyFileContent(targetPath string, content []byte) error

func OpenFileForAppend

func OpenFileForAppend(filePath string) (*os.File, error)

Types

type FS

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

func NewFS

func NewFS(embeddedFS *embed.FS, root string) *FS

func (*FS) CopyFile

func (fs *FS) CopyFile(filePath, targetPath string) error

func (*FS) Execute

func (fs *FS) Execute(op *Operation) (err error)

func (*FS) FileExists

func (fs *FS) FileExists(filePath string) bool

func (*FS) MergeTemplateData

func (fs *FS) MergeTemplateData(templateData interface{}, filePath string) (*bytes.Buffer, error)

func (*FS) ReadTemplateFile added in v0.3.0

func (fs *FS) ReadTemplateFile(filePath string) ([]byte, error)

type OnEachFile

type OnEachFile func(filePath string, targetPath string) error

type Operation

type Operation struct {
	SourceDir  string
	TargetDir  string
	OnEachFile OnEachFile
	Recursive  bool
}

Jump to

Keyboard shortcuts

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