Documentation ¶
Index ¶
- Constants
- Variables
- type Backend
- type FileBackend
- func (f FileBackend) DeleteAlarm(name string)
- func (f FileBackend) DeleteService(name string)
- func (r FileBackend) LoadAlarms() []*model.Alarm
- func (r FileBackend) LoadServices() []*model.Service
- func (f FileBackend) SaveAlarm(alarm *model.Alarm)
- func (f FileBackend) SaveService(service *model.Service)
- func (f FileBackend) Sync()
Constants ¶
View Source
const MAX_PENDING_WRITES = 1000
Variables ¶
View Source
var ( RECORD_SERVICE = []byte("SERV\t") RECORD_ALARM = []byte("ALARM\t") NEWLINE = []byte("\n") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { LoadServices() []*model.Service LoadAlarms() []*model.Alarm SaveService(service *model.Service) SaveAlarm(alarm *model.Alarm) DeleteService(name string) DeleteAlarm(name string) Sync() }
func NewFileBackend ¶
type FileBackend ¶
type FileBackend struct {
// contains filtered or unexported fields
}
func (FileBackend) DeleteAlarm ¶
func (f FileBackend) DeleteAlarm(name string)
func (FileBackend) DeleteService ¶
func (f FileBackend) DeleteService(name string)
func (FileBackend) LoadAlarms ¶
func (r FileBackend) LoadAlarms() []*model.Alarm
func (FileBackend) LoadServices ¶
func (r FileBackend) LoadServices() []*model.Service
func (FileBackend) SaveAlarm ¶
func (f FileBackend) SaveAlarm(alarm *model.Alarm)
func (FileBackend) SaveService ¶
func (f FileBackend) SaveService(service *model.Service)
func (FileBackend) Sync ¶
func (f FileBackend) Sync()
Click to show internal directories.
Click to hide internal directories.