pkg

package
v0.0.0-...-68bba95 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultProcPath = "/proc"

DefaultProcPath is the default path to the /proc directory. It is used internally for testing and can be changed to the "testdata" directory for testing purposes.

Functions

This section is empty.

Types

type ProcFile

type ProcFile struct {
	File    fs.File        // File handle
	Scanner *bufio.Scanner // Scanner for reading the file
}

ProcFile represents a proc file, including its file handle and scanner for reading.

func NewProcFile

func NewProcFile(name string) (*ProcFile, error)

NewProcFile creates a new ProcFile instance by opening the specified proc file path. It opens the file, creates a bufio.Scanner to read it, and returns the ProcFile instance. If any errors occur during file opening or scanner creation, it returns an error.

func (*ProcFile) Close

func (pf *ProcFile) Close() error

Close closes the proc file by closing its file handle.

func (*ProcFile) SplitWords

func (pf *ProcFile) SplitWords()

SplitWords configures the scanner to split words using bufio.ScanWords.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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