Help us shape the future of Go! Take the 2026 Go Developer Survey

filelock

package module
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 27

README

filelock

Go Report Card Go Reference

This library will allow locking a file for synchronous operation.

[!NOTE]

This repository should be imported as code.cloudfoundry.org/filelock.

Contributing

See the Contributing.md for more information on how to contribute.

Working Group Charter

This repository is maintained by App Runtime Platform under Garden Containers area.

[!IMPORTANT]

Content in this file is managed by the CI task sync-readme and is generated by CI following a convention.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLocker

type FileLocker interface {
	Open() (LockedFile, error)
}

func NewLocker

func NewLocker(path string) FileLocker

type LockedFile

type LockedFile interface {
	Close() error
	Read([]byte) (int, error)
	Truncate(int64) error
	Write([]byte) (int, error)
	Seek(int64, int) (int64, error)
}

type Locker

type Locker struct {
	FileLocker FileLocker
	Mutex      *sync.Mutex
	// contains filtered or unexported fields
}

func (*Locker) Lock

func (l *Locker) Lock() error

func (*Locker) Unlock

func (l *Locker) Unlock() error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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