detectors

package
v0.0.0-...-26052f9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DotnetDetector

type DotnetDetector struct {
	// contains filtered or unexported fields
}

DotnetDetector detects .NET processes.

func NewDotnetDetector

func NewDotnetDetector() DotnetDetector

NewDotnetDetector creates a new instance of DotnetDetector.

func (DotnetDetector) DetectLanguage

func (d DotnetDetector) DetectLanguage(process languagemodels.Process) (languagemodels.Language, error)

DetectLanguage detects if a process is a .NET process. It does this by using /proc/PID/maps to check if the process has mapped a standard .NET dll. This works for non-single-file deployments (both self-contained and framework-dependent), and framework-dependent single-file deployments.

It does not work for self-contained single-file deployments since these do not have any DLLs in their maps file.

type GoDetector

type GoDetector struct {
	// contains filtered or unexported fields
}

func NewGoDetector

func NewGoDetector() GoDetector

func (GoDetector) DetectLanguage

func (d GoDetector) DetectLanguage(process languagemodels.Process) (languagemodels.Language, error)

DetectLanguage allows for detecting if a process is a go process, and its version. Note that currently the goDetector only returns non-retriable errors since in all cases we will not be able to detect the language. Scenarios in which we can return an error:

  • Program exits early, and we fail to call `safeelf.Open`. Note that in the future it may be possible to lock the directory using a system call.
  • Program is not a go binary, or has build tags stripped out. In this case we return a `dderrors.NotFound`.

type JRubyDetector

type JRubyDetector struct{}

JRubyDetector is a languagedetection.Detector that detects JRuby processes

func (JRubyDetector) DetectLanguage

func (d JRubyDetector) DetectLanguage(process languagemodels.Process) (languagemodels.Language, error)

Jump to

Keyboard shortcuts

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