fs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 3 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 {
	// contains filtered or unexported fields
}

FS gathers services related to filesystem operations.

func New

func New(opts ...Option) *FS

New returns a handler for filesystem related activities.

func (*FS) TempDir

func (f *FS) TempDir() (string, func(), error)

TempDir creates and returns a temporary dir inside our base temp dir specified on FS.tmpdir. Returns the directory path, a clean up function (delete dir) or an error.

func (*FS) TempFile

func (f *FS) TempFile() (*os.File, func(), error)

TempFile creates and returns a temporary file inside our base temp directory. Returns the opened file, a clean up function (close and delete file) or an error.

type Option

type Option func(*FS)

Option sets an option in a FS instance.

func WithTmpDir

func WithTmpDir(tmpdir string) Option

WithTmpDir sets a different base temp directory.

Jump to

Keyboard shortcuts

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