Documentation ¶
Overview ¶
Package file implements file utils.
Index ¶
- Variables
- func CheckExecutable(file string) error
- func CheckFDLimitSupported() bool
- func CheckFileHandlesSupported() bool
- func FindLibrary(name string, opts ...OpOption) (string, error)
- func GetFileHandles() (uint64, uint64, error)
- func GetLimit() (uint64, error)
- func GetUsage() (uint64, error)
- func LocateExecutable(bin string) (string, error)
- type Op
- type OpOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLibraryEmpty = errors.New("library name is empty") ErrLibraryNotFound = errors.New("library not found") )
Functions ¶
func CheckExecutable ¶
func CheckFDLimitSupported ¶ added in v0.2.0
func CheckFDLimitSupported() bool
func CheckFileHandlesSupported ¶ added in v0.3.1
func CheckFileHandlesSupported() bool
Returns true if the file handles are supported.
func GetFileHandles ¶ added in v0.3.1
Returns the number of allocated file handles and the number of allocated but unused file handles.
func GetLimit ¶ added in v0.2.0
Returns the current file descriptor limit for the host, not for the current process. for the current process, use syscall.Getrlimit.
func GetUsage ¶ added in v0.2.0
"process_open_fds" in prometheus collector ref. https://github.com/prometheus/client_golang/blob/main/prometheus/process_collector_other.go ref. https://pkg.go.dev/github.com/prometheus/procfs
func LocateExecutable ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.