pluginlib

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pluginlib reads which version of this module (the agent library) a plugin binary was built with (R76). The config report lists it per plugin as diagnostics.

Plugins evaluate policies with the policy-manager they embed, so how a plugin evaluates a policy depends on the agent library it was compiled against, not on the running agent. The version comes from the binary's Go build info (debug/buildinfo), so the plugin is never started to find out.

Index

Constants

View Source
const AgentModule = "github.com/compliance-framework/agent"

AgentModule is the module path plugins import for runner and policy-manager.

Variables

This section is empty.

Functions

func Version

func Version(path string) (string, error)

Version returns the version of AgentModule the plugin binary at path was built with, or "" when it is unknown: the file has no Go build info, does not depend on AgentModule (a non-Go or unrelated binary), or replaces it (a local build, where the version says nothing about the code). An error is returned only when the file cannot be read as a Go binary.

Types

type Cache

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

Cache memoizes Version per binary. A binary is identified by its path, size and modification time, so a plugin replaced in place is read again. It is safe for concurrent use.

func (*Cache) Version

func (c *Cache) Version(path string) (string, error)

Version is the package-level Version, memoized.

Jump to

Keyboard shortcuts

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