fs

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fs provides helper to work with the filesystem, e.g. temporary directories or files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TempDir

type TempDir struct {
	// Path to the temporary directory
	Path string
}

func NewTempDir

func NewTempDir() (*TempDir, error)

NewTempDir creates a new temporary directory.

func (*TempDir) Close

func (d *TempDir) Close() error

Close will remove the temporary directory.

type TempFile

type TempFile struct {
	// Path of the temporary file
	Path string
}

func NewTempFile

func NewTempFile(content []byte) (*TempFile, error)

NewTempFile creates a new temporary file in a temporary directory. The provided content is written to the file. Make sure to always call Close once the file is not required anymore.

func (*TempFile) Close

func (f *TempFile) Close() error

Close will remove the temporary directory containing the file.

Jump to

Keyboard shortcuts

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