file

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2019 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LockFileSuffix = ".lock"
	TempFileSuffix = ".temp"
)

Variables

View Source
var RetryInterval = 50 * time.Millisecond
View Source
var WaitTimeout = 30.0

Functions

func Exists added in v1.6.0

func Exists(path string) bool

func LockFilePath

func LockFilePath(path string) string

func NewForcedUnlockError added in v1.6.0

func NewForcedUnlockError(errs []error) error

func NewIOError

func NewIOError(message string) error

func NewLockError

func NewLockError(message string) error

func NewTimeoutError

func NewTimeoutError(path string) error

func ParseError

func ParseError(err error) error

func TempFilePath added in v1.6.0

func TempFilePath(path string) string

func UnlockAll

func UnlockAll() error

func UnlockAllWithErrors added in v1.6.0

func UnlockAllWithErrors() error

func UpdateWaitTimeout

func UpdateWaitTimeout(waitTimeout float64, retryInterval time.Duration)

Types

type ForcedUnlockError added in v1.6.0

type ForcedUnlockError struct {
	Errors []error
}

func (ForcedUnlockError) Error added in v1.6.0

func (e ForcedUnlockError) Error() string

type Handler added in v1.6.0

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandlerForCreate added in v1.6.0

func NewHandlerForCreate(path string) (*Handler, error)

func NewHandlerForRead added in v1.6.0

func NewHandlerForRead(path string) (*Handler, error)

func NewHandlerForUpdate added in v1.6.0

func NewHandlerForUpdate(path string) (*Handler, error)

func (*Handler) Close added in v1.6.0

func (h *Handler) Close() error

func (*Handler) CloseWithErrors added in v1.6.0

func (h *Handler) CloseWithErrors() error

func (*Handler) Commit added in v1.6.0

func (h *Handler) Commit() error

func (*Handler) FileForRead added in v1.6.0

func (h *Handler) FileForRead() *os.File

func (*Handler) FileForUpdate added in v1.6.0

func (h *Handler) FileForUpdate() *os.File

func (*Handler) Path added in v1.6.0

func (h *Handler) Path() string

func (*Handler) PrepareToRead added in v1.6.0

func (h *Handler) PrepareToRead() error

func (*Handler) TryCreateLockFile added in v1.6.0

func (h *Handler) TryCreateLockFile() error

func (*Handler) TryCreateLockFileWithTimeout added in v1.6.0

func (h *Handler) TryCreateLockFileWithTimeout() error

func (*Handler) TryCreateTempFile added in v1.6.0

func (h *Handler) TryCreateTempFile() error

type IOError

type IOError struct {
	// contains filtered or unexported fields
}

func (IOError) Error

func (e IOError) Error() string

type LockError

type LockError struct {
	// contains filtered or unexported fields
}

func (LockError) Error

func (e LockError) Error() string

type OpenType added in v1.6.0

type OpenType int
const (
	ForRead OpenType = iota
	ForCreate
	ForUpdate
)

type TimeoutError

type TimeoutError struct {
	// contains filtered or unexported fields
}

func (TimeoutError) Error

func (e TimeoutError) Error() string

Jump to

Keyboard shortcuts

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