diff options
Diffstat (limited to 'pkg/icingadb/v1/overdue/host.go')
-rw-r--r-- | pkg/icingadb/v1/overdue/host.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/icingadb/v1/overdue/host.go b/pkg/icingadb/v1/overdue/host.go new file mode 100644 index 0000000..9d42994 --- /dev/null +++ b/pkg/icingadb/v1/overdue/host.go @@ -0,0 +1,26 @@ +package overdue + +import ( + "github.com/icinga/icingadb/pkg/contracts" + v1 "github.com/icinga/icingadb/pkg/icingadb/v1" + "github.com/icinga/icingadb/pkg/types" +) + +type HostState struct { + v1.EntityWithoutChecksum + IsOverdue types.Bool `json:"is_overdue"` +} + +func NewHostState(id string, overdue bool) (contracts.Entity, error) { + hs := &HostState{IsOverdue: types.Bool{ + Bool: overdue, + Valid: true, + }} + + return hs, hs.Id.UnmarshalText([]byte(id)) +} + +// Assert interface compliance. +var ( + _ contracts.Entity = (*HostState)(nil) +) |