module
0.0.0-20231018185634-ce906b15f9e8
Repository: https://github.com/opdev/knex.git
Documentation: pkg.go.dev
# README
knex
Pluggable Certification.
Building and Registering a Plugin
- Implement the Plugin
- Create an
init
function somewhere in your plugin codebase that calls the Register function - Submit a PR to the repository adding a blank-initialization of your plugin code (ex. here)
- Ensure the go.mod value for your plugin points to your version. The repository encourages semantic versioning, and will represent plugin versions to users. You are encouraged to ensure version changes are associated with new behaviors.
Writing Logs and Artifacts
- Knex will pass a logger and an artifact writer to your plugin via the
context
. - For the logger, utilize the logr helper function FromContextOrDiscard (or equivalents).
- For ArtifactsWriter, utilize the helper function WriterFromContext
- Plugins are generally discouraged from reconfiguring the included logger or artifact writer.
Binding Environment/Flags
- A plugin will be passed a
pflag.FlagSet to its
BindFlags
method. It should bind all flags necessary for the plugin to operate at this time. - These flags are converted to environment variables using viper's
AutomaticEnv. Users
will need to prefix your environment variables with
PFLT_
.- Dashes are converted to hyphens.
- Other non-env special characters are not supported (e.g. period)
# Packages
No description provided by the author
Package formatters defines the abstractions used to properly format a preflight Result.
Package log is a preflight-local logrus bridge, removing the dependency on logrus' global logger instance.
No description provided by the author
Package types contains all types relevant to this PoC.
Package version contains all identifiable versioning info for describing the knex project.