Documentation ¶
Index ¶
- Constants
- func CopyFile(dst, src string, perm os.FileMode) error
- func MustCreateReader(p string) io.ReadCloser
- func MustCreateWriter(p string) io.WriteCloser
- func New(opts ...Option) *driver
- func NewFileReader(file string) (f io.ReadCloser, err error)
- func NewFileWriter(file string) (w io.WriteCloser, err error)
- func Type() filab.DriverType
- type DirMode
- type FileMode
- type LocalPath
- func (l LocalPath) BaseStr() string
- func (l LocalPath) Copy() filab.Path
- func (l LocalPath) Dir() filab.Path
- func (l LocalPath) DirStr() string
- func (l LocalPath) Join(p ...string) filab.Path
- func (LocalPath) New(s string) filab.Path
- func (l LocalPath) String() string
- func (LocalPath) Type() filab.DriverType
- type Option
Constants ¶
View Source
const ( DefaultDirPerm = 0740 DefaultFilePerm = 0640 )
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
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 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 LocalPath ¶
type LocalPath string
func ParseLocalPath ¶
func (LocalPath) Type ¶
func (LocalPath) Type() filab.DriverType
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithDirMode ¶
func WithFileMode ¶
func WithNewDir ¶
func WithNewDir() Option
WithNewDir makes a driver to create new directories if they do not exist.
Click to show internal directories.
Click to hide internal directories.