1
0
Fork 0

Big rafactoring : code split in several modules and some other best practices

This commit is contained in:
Julien Dessaux 2020-01-30 17:44:42 +01:00
parent e07ce016c4
commit bea8e5aba8
16 changed files with 506 additions and 386 deletions

21
state/state.go Normal file
View file

@ -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
}