backend

package
v0.0.0-...-3651c1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

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

func NewFileBackend(cfg *config.ConfigDatabase, m metrics.Metrics, notifier notify.Notifier) Backend

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL