From ebdb99be8b616c137398cbf66d7e654eeded4597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20BENO=C3=8ET?= Date: Fri, 19 Jul 2024 23:24:19 +0200 Subject: [PATCH] refactor(pkg): split `plugin` into multiple files --- pkg/plugin/plugin.go | 18 ------------------ pkg/plugin/status.go | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 pkg/plugin/status.go diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go index f32e360..c78a196 100644 --- a/pkg/plugin/plugin.go +++ b/pkg/plugin/plugin.go @@ -11,24 +11,6 @@ import ( "nocternity.net/gomonop/pkg/perfdata" ) -// Status represents the return status of the monitoring plugin. The -// corresponding integer value will be used as the program's exit code, -// to be interpreted by the monitoring system. -type Status int - -// Plugin exit statuses. -const ( - OK Status = iota - WARNING - CRITICAL - UNKNOWN -) - -// String representations of the plugin statuses. -func (s Status) String() string { - return [...]string{"OK", "WARNING", "ERROR", "UNKNOWN"}[s] -} - // Plugin represents the monitoring plugin's state, including its name, // return status and message, additional lines of text, and performance // data to be encoded in the output. diff --git a/pkg/plugin/status.go b/pkg/plugin/status.go new file mode 100644 index 0000000..b7db5a8 --- /dev/null +++ b/pkg/plugin/status.go @@ -0,0 +1,19 @@ +package plugin // import nocternity.net/gomonop/pkg/perfdata + +// Status represents the return status of the monitoring plugin. The +// corresponding integer value will be used as the program's exit code, +// to be interpreted by the monitoring system. +type Status int + +// Plugin exit statuses. +const ( + OK Status = iota + WARNING + CRITICAL + UNKNOWN +) + +// String representations of the plugin statuses. +func (s Status) String() string { + return [...]string{"OK", "WARNING", "ERROR", "UNKNOWN"}[s] +}