aboutsummaryrefslogtreecommitdiff
path: root/state/state.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 /state/state.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--state/state.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/state/state.go b/state/state.go
new file mode 100644
index 0000000..d28a701
--- /dev/null
+++ b/state/state.go
@@ -0,0 +1,21 @@
+package state
+
+import (
+ "bareos-zabbix-check/config"
+ "bareos-zabbix-check/job"
+)
+
+// maxNameLength : the maximum length of a string, hard coded in bareos
+const maxNameLength = 128
+
+// State is an object for manipulating a bareos state file
+type State struct {
+ config *config.Config
+ header header
+ jobs []job.Job
+}
+
+// Jobs returns the jobs from the state file
+func (s *State) Jobs() []job.Job {
+ return s.jobs
+}