Documentation
¶
Index ¶
- Variables
- func AbsPath(ctx context.Context, process detector.Process, path string) (string, error)
- func BaseExe(exe string) string
- func BaseName(path string) string
- func IsValidPort(port int) bool
- func NewCachedProcess(p detector.Process) detector.Process
- func NewProcessWithPID(process *process.Process) detector.Process
- func ScanProperties(r io.Reader, separator rune, fn func(key, value string) bool) error
- func TrimQuotes(s string) string
- type CachedProcess
- func (p *CachedProcess) CmdlineSliceWithContext(ctx context.Context) ([]string, error)
- func (p *CachedProcess) CreateTimeWithContext(ctx context.Context) (int64, error)
- func (p *CachedProcess) CwdWithContext(ctx context.Context) (string, error)
- func (p *CachedProcess) EnvironWithContext(ctx context.Context) ([]string, error)
- func (p *CachedProcess) ExeWithContext(ctx context.Context) (string, error)
- func (p *CachedProcess) OpenFilesWithContext(ctx context.Context) ([]detector.OpenFilesStat, error)
- func (p *CachedProcess) PID() int32
- type ProcessWithPID
Constants ¶
This section is empty.
Variables ¶
var (
ErrLineLimitExceeded = errors.New("line limit exceeded")
)
Functions ¶
func BaseExe ¶
BaseExe returns the executable name from a path. Normalizes the name by removing file extensions and converting to lowercase to support cross-platform comparisons.
func BaseName ¶ added in v1.300062.0
BaseName returns the base filename from a path. Removes quotes and deleted file indicators. Preserves file extensions and casing.
func IsValidPort ¶
func ScanProperties ¶ added in v1.300062.0
ScanProperties parses key-value pairs from a reader and passes them to the fn. Returns early if fn returns false, the line limit is reached, or if the scanner has an error. Uses the defaultLineLimit.
func TrimQuotes ¶
Types ¶
type CachedProcess ¶
type CachedProcess struct {
// contains filtered or unexported fields
}
CachedProcess provides a caching wrapper around the detector.Process. It caches the fields after their first retrieval.
func (*CachedProcess) CmdlineSliceWithContext ¶
func (p *CachedProcess) CmdlineSliceWithContext(ctx context.Context) ([]string, error)
func (*CachedProcess) CreateTimeWithContext ¶
func (p *CachedProcess) CreateTimeWithContext(ctx context.Context) (int64, error)
func (*CachedProcess) CwdWithContext ¶
func (p *CachedProcess) CwdWithContext(ctx context.Context) (string, error)
func (*CachedProcess) EnvironWithContext ¶
func (p *CachedProcess) EnvironWithContext(ctx context.Context) ([]string, error)
func (*CachedProcess) ExeWithContext ¶
func (p *CachedProcess) ExeWithContext(ctx context.Context) (string, error)
func (*CachedProcess) OpenFilesWithContext ¶ added in v1.300062.0
func (p *CachedProcess) OpenFilesWithContext(ctx context.Context) ([]detector.OpenFilesStat, error)
func (*CachedProcess) PID ¶
func (p *CachedProcess) PID() int32
type ProcessWithPID ¶
ProcessWithPID provides a wrapper for the gopsutil process.Process to expose the PID.
func (*ProcessWithPID) PID ¶
func (p *ProcessWithPID) PID() int32