fs

package
v0.0.0-...-1f9b3f3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fs provides a client for writing and removing files on the local filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(vl func(f string, v ...interface{}))

Configure sets the logger for this package.

func IsExist

func IsExist(err error) bool

func IsNotExist

func IsNotExist(err error) bool

Types

type FsClient

type FsClient struct{}

FsClient is a filesystem client.

func NewFsClient

func NewFsClient() (*FsClient, error)

NewFsClient returns a new FsClient.

func (*FsClient) MkdirAll

func (fsc *FsClient) MkdirAll(path string, perm os.FileMode) error

MkdirAll creates all folders (including the last) for the given path.

func (*FsClient) Remove

func (fsc *FsClient) Remove(destination string) error

Remove removes the destination path, and any children. See os.RemoveAll.

func (fsc *FsClient) Symlink(oldname, newname string) error

Symlink creates a symlink at newname pointing at oldname.

func (*FsClient) Write

func (fsc *FsClient) Write(destination string, raw []byte, perm os.FileMode) error

Write creates any necessary parent directories, and then writes the file to destination. See os.MkdirAll and ioutil.WriteFile.

Jump to

Keyboard shortcuts

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