Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CategoryForIdentity ¶
func CategoryForIdentity(ident *AppIdentity) string
CategoryForIdentity also corrects persisted name-based guesses when read.
func FallbackName ¶
FallbackName identifies command-name-only records written by older versions.
func MatchFallback ¶
func MatchFallback(key string, candidates []*AppIdentity) string
MatchFallback prefers a unique full executable path. With no matching path, legacy short-lived and plain command-name records share one fallback bucket. Ambiguous executable paths stay separate; names never combine full paths.
Types ¶
type AppIdentity ¶
type AppIdentity struct {
AppKey string `json:"app_key"`
DisplayName string `json:"display_name"`
Category string `json:"category"`
IconOrType string `json:"icon_or_type"`
ExecutablePath string `json:"executable_path"`
CgroupPath string `json:"cgroup_path"`
FirstSeen time.Time `json:"first_seen"`
LastSeen time.Time `json:"last_seen"`
}
AppIdentity represents a stable application identity
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves temporary PIDs and system metadata into stable AppIdentities
func NewResolver ¶
func NewResolver() *Resolver
NewResolver creates and initializes an identity resolver
func (*Resolver) ResolvePID ¶
func (r *Resolver) ResolvePID(pid uint32) *AppIdentity
ResolvePID determines the stable AppIdentity for a given PID
func (*Resolver) SeedIdentities ¶
func (r *Resolver) SeedIdentities(identities []*AppIdentity)
SeedIdentities lets command-name fallbacks reuse paths observed before a daemon restart, without guessing when several executables share a name.