file

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RLockFileSuffix = ".rlock"
	LockFileSuffix  = ".lock"
	TempFileSuffix  = ".temp"
)
View Source
const DefaultRetryDelay = 10 * time.Millisecond
View Source
const DefaultWaitTimeout = 10 * time.Second

Variables

This section is empty.

Functions

func Exists added in v1.6.0

func Exists(path string) bool

func GetTimeoutContext added in v1.9.3

func GetTimeoutContext(ctx context.Context, waitTimeOut time.Duration) (context.Context, context.CancelFunc)

func LockExists added in v1.9.6

func LockExists(path string) bool

func LockFilePath

func LockFilePath(path string) string

func NewAlreadyExistError added in v1.9.8

func NewAlreadyExistError(message string) error

func NewCompositeError added in v1.9.3

func NewCompositeError(err1 error, err2 error) error

func NewContextCanceled added in v1.9.10

func NewContextCanceled() error

func NewContextDone added in v1.9.10

func NewContextDone(message string) error

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 NewNotExistError added in v1.9.8

func NewNotExistError(message string) error

func NewTimeoutError

func NewTimeoutError(path string) error

func ParseError

func ParseError(err error) error

func RLockExists added in v1.9.6

func RLockExists(path string) bool

func RLockFilePath added in v1.9.6

func RLockFilePath(path string) string

func TempFilePath added in v1.6.0

func TempFilePath(path string) string

Types

type AlreadyExistError added in v1.9.8

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

func (AlreadyExistError) Error added in v1.9.8

func (e AlreadyExistError) Error() string

type CompositeError added in v1.9.3

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

func (CompositeError) Error added in v1.9.3

func (e CompositeError) Error() string

type Container added in v1.9.3

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

func NewContainer added in v1.9.3

func NewContainer() *Container

func (*Container) Add added in v1.9.3

func (c *Container) Add(path string, handler *Handler) error

func (*Container) Close added in v1.9.3

func (c *Container) Close(h *Handler) error

func (*Container) CloseAll added in v1.9.6

func (c *Container) CloseAll() error

func (*Container) CloseAllWithErrors added in v1.9.6

func (c *Container) CloseAllWithErrors() error

func (*Container) CloseWithErrors added in v1.9.3

func (c *Container) CloseWithErrors(h *Handler) (err error)

func (*Container) Commit added in v1.9.3

func (c *Container) Commit(h *Handler) error

func (*Container) Keys added in v1.9.3

func (c *Container) Keys() []string

func (*Container) Remove added in v1.9.3

func (c *Container) Remove(path string)

type ContextCanceled added in v1.9.10

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

func (ContextCanceled) Error added in v1.9.10

func (e ContextCanceled) Error() string

type ContextDone added in v1.9.10

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

func (ContextDone) Error added in v1.9.10

func (e ContextDone) Error() string

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(container *Container, path string) (*Handler, error)

func NewHandlerForRead added in v1.6.0

func NewHandlerForRead(ctx context.Context, container *Container, path string, defaultWaitTimeout time.Duration, retryDelay time.Duration) (*Handler, error)

func NewHandlerForUpdate added in v1.6.0

func NewHandlerForUpdate(ctx context.Context, container *Container, path string, defaultWaitTimeout time.Duration, retryDelay time.Duration) (*Handler, error)

func NewHandlerWithoutLock added in v1.9.8

func NewHandlerWithoutLock(ctx context.Context, container *Container, path string, defaultWaitTimeout time.Duration, retryDelay time.Duration) (*Handler, error)

func (*Handler) CreateManagementFileContext added in v1.9.6

func (h *Handler) CreateManagementFileContext(ctx context.Context, retryDelay time.Duration, fileType mngFileType) error

func (*Handler) File added in v1.9.6

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

func (*Handler) FileForUpdate added in v1.6.0

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

func (*Handler) Path added in v1.6.0

func (h *Handler) Path() string

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 NotExistError added in v1.9.8

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

func (NotExistError) Error added in v1.9.8

func (e NotExistError) 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