Documentation ¶
Overview ¶
Package bin exports functionality for working with files (CRUD) in a concurrent-safe fashion. Bin is an acronym for binary; don't struggle with file operations; focus on the binary. Note that the concurrent-safe guarantee is only valid when working with a filesystem that supports atomicity for common file operations (e.g. create, rename, remove, etc.).
Index ¶
- func DefLckPath(path string) string
- func ErrIfExists(path string) error
- func ErrIfNotExist(path string) error
- func Lck(path string) (*os.File, error)
- func New(path string, b io.Reader) error
- func NewBare(path string, b io.Reader) error
- func NewLckPath(path string, b io.Reader, lckPath string) error
- func Open(path string) (*os.File, error)
- func Over(path string, b io.Reader) error
- func OverBare(path string, b io.Reader) error
- func OverLckPath(path string, b io.Reader, lckPath string) error
- func Rm(path string) (rErr error)
- func RmBare(path string) error
- func RmLckPath(path string, lckPath string) (rErr error)
- func Unlck(path string, f *os.File) (rErr error)
- type Dir
- func (d *Dir) All() (rNs []string, rErr error)
- func (d *Dir) Dir() string
- func (d *Dir) New(name string, b io.Reader) error
- func (d *Dir) Open(name string) (*os.File, error)
- func (d *Dir) Over(name string, b io.Reader) error
- func (d *Dir) Path(name string) string
- func (d *Dir) Rm(name string) (rErr error)
- type ErrExists
- type ErrLcked
- type ErrNotExist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefLckPath ¶
func ErrIfExists ¶
func ErrIfNotExist ¶
Types ¶
type Dir ¶
type Dir string
Dir is just a fancy wrapper around global bin functions; a binary repository that saves all bins in a specified directory. Note that any name argument should be a valid file name (e.g. no filepath.Separator within); otherwise, strange things will happen.
type ErrNotExist ¶
type ErrNotExist string
func NewErrNotExist ¶
func NewErrNotExist(path string) *ErrNotExist
func (*ErrNotExist) Error ¶
func (e *ErrNotExist) Error() string
Click to show internal directories.
Click to hide internal directories.