local

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDirPerm  = 0740
	DefaultFilePerm = 0640
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(dst, src string, perm os.FileMode) error

CopyFile copies the contents from src to dst atomically. If dst does not exist, CopyFile creates it with permissions perm. If the copy fails, CopyFile aborts and dst is preserved.

Modified version of: https://go-review.googlesource.com/c/go/+/1591

func MustCreateReader

func MustCreateReader(p string) io.ReadCloser

func MustCreateWriter

func MustCreateWriter(p string) io.WriteCloser

func New

func New(opts ...Option) *driver

func NewFileReader

func NewFileReader(file string) (f io.ReadCloser, err error)

func NewFileWriter

func NewFileWriter(file string) (w io.WriteCloser, err error)

func Type

func Type() filab.DriverType

Types

type DirMode

type DirMode os.FileMode

type FileMode

type FileMode os.FileMode

type LocalPath

type LocalPath string

func ParseLocalPath

func ParseLocalPath(s string) (LocalPath, error)

func (LocalPath) BaseStr added in v1.1.0

func (l LocalPath) BaseStr() string

func (LocalPath) Copy

func (l LocalPath) Copy() filab.Path

func (LocalPath) Dir added in v1.1.0

func (l LocalPath) Dir() filab.Path

func (LocalPath) DirStr added in v1.1.0

func (l LocalPath) DirStr() string

func (LocalPath) Join

func (l LocalPath) Join(p ...string) filab.Path

func (LocalPath) New

func (LocalPath) New(s string) filab.Path

func (LocalPath) String

func (l LocalPath) String() string

func (LocalPath) Type

func (LocalPath) Type() filab.DriverType

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithDirMode

func WithDirMode(mode os.FileMode) Option

func WithFileMode

func WithFileMode(mode os.FileMode) Option

func WithNewDir

func WithNewDir() Option

WithNewDir makes a driver to create new directories if they do not exist.

Jump to

Keyboard shortcuts

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