fsutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebug

func SetDebug(debug bool)

Enable the delivery of debug messages to the logger. Only meaningful if a logger is also set.

func SetLogger

func SetLogger(logger log_Logger)

Specify the *log.Logger object where log messages should be sent to.

Types

type CreateOptions

type CreateOptions struct {
	Path string
	Mode fs.FileMode
	Data io.Reader
	Link string
	// If MakeParents is true, missing parent directories of Path are
	// created with permissions 0755.
	MakeParents bool
}

type Entry added in v0.9.1

type Entry struct {
	Path   string
	Mode   fs.FileMode
	SHA256 string
	Size   int
	Link   string
}

func Create

func Create(options *CreateOptions) (*Entry, error)

Create creates a filesystem entry according to the provided options and returns the information about the created entry.

func CreateWriter added in v1.0.0

func CreateWriter(options *CreateOptions) (io.WriteCloser, *Entry, error)

CreateWriter handles the creation of a regular file and collects the information recorded in Entry. The Hash and Size attributes are set on calling Close() on the Writer.

Jump to

Keyboard shortcuts

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