pidfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = errors.New("pidfile")
)

Functions

This section is empty.

Types

type File

type File struct {
	*os.File
}

File wraps *os.File and provides api for pidfile management.

func New

func New(name string, pid int, perm os.FileMode) (*File, error)

func Open

func Open(name string) (*File, error)

func (*File) Lock

func (pf *File) Lock() error

Lock apply exclusive lock on pidfile.

func (*File) PID

func (pf *File) PID() (pid int, err error)

func (*File) Remove

func (pf *File) Remove() error

func (*File) Unlock

func (pf *File) Unlock() error

Unlock remove exclusive lock on an open pidfile.

Jump to

Keyboard shortcuts

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