aboutsummaryrefslogtreecommitdiff
path: root/spool/spool.go
diff options
context:
space:
mode:
authorJulien Dessaux2020-01-30 17:44:42 +0100
committerJulien Dessaux2020-01-30 17:44:42 +0100
commitbea8e5aba8fc84dcb0c980c3948ed6d78719dded (patch)
treef84f2722b98f4c2996b64ce24ac322c9709617ed /spool/spool.go
parentDocument where C structures for state file header and job entry come from (diff)
downloadbareos-zabbix-check-bea8e5aba8fc84dcb0c980c3948ed6d78719dded.tar.gz
bareos-zabbix-check-bea8e5aba8fc84dcb0c980c3948ed6d78719dded.tar.bz2
bareos-zabbix-check-bea8e5aba8fc84dcb0c980c3948ed6d78719dded.zip
Big rafactoring : code split in several modules and some other best practices
Diffstat (limited to '')
-rw-r--r--spool/spool.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/spool/spool.go b/spool/spool.go
new file mode 100644
index 0000000..e095979
--- /dev/null
+++ b/spool/spool.go
@@ -0,0 +1,26 @@
+package spool
+
+import (
+ "bareos-zabbix-check/config"
+ "bareos-zabbix-check/job"
+)
+
+const (
+ spoolFile = "bareos-zabbix-check.spool"
+)
+
+// Spool is an object for manipulating a bareos spool file
+type Spool struct {
+ config *config.Config
+ jobs []job.Job
+}
+
+// Jobs exports a spool to a jobs list
+func (s *Spool) Jobs() []job.Job {
+ return s.jobs
+}
+
+// SetJobs sets a jobs list
+func (s *Spool) SetJobs(jobs []job.Job) {
+ s.jobs = jobs
+}