Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvLogLevel = "PLUGIN_SERVER_LOG_LEVEL" DefaultLogLevel = "info" EnvListenAddress = "PLUGIN_SERVER_LISTEN_ADDRESS" DefaultListenAddress = "http://0.0.0.0:8080" )
View Source
const APIVersion = "1.0.0"
APIVersion defines the current version of the Scanner Plugin API.
Variables ¶
This section is empty.
Functions ¶
func GetLogger ¶
GetLogger defines JSON logger that outputs to stdout with level loaded fom EnvLogLevel.
func Run ¶
Run starts Plugin HTTP Server and uses provided Scanner to respond to requests. Run logs data to standard output using GetLogger. This operation blocks until exit. It handles graceful termination. Server listens on address loaded from EnvListenAddress. It exists with exit code 1 on error. Run simplifies the main logic. Can only be called once.
Usage example:
import (
"github.com/openclarity/vmclarity/plugins/sdk-go/plugin" "github.com/openclarity/vmclarity/plugins/sdk-go/types" ) func main() { var myScanner types.Scanner // your implementation of Scanner interface plugin.Run(myScanner) // start server until exit }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.