scheduler

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MapperTopicPrefix     = "$ke/device/bluetooth-mapper/"
	SchedulerResultSuffix = "/scheduler/result"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

type Schedule struct {
	// Name is name of the schedule. It should be unique so that a stop-chan
	// can be made corresponding to name to stop the schedule.
	Name string `yaml:"name" json:"name"`
	// Interval is the time in milliseconds after which this action are to be performed
	Interval int `yaml:"interval" json:"interval"`
	//OccurrenceLimit refers to the number of time the action can occur, if it is 0, then the  event will execute infinitely
	OccurrenceLimit int `yaml:"occurrence-limit" json:"occurrence-limit"`
	// Actions is list of Actions to be performed in this schedule
	Actions []string `yaml:"actions"`
}

Schedule is structure to define a schedule

func (*Schedule) ExecuteSchedule

func (schedule *Schedule) ExecuteSchedule(actionManager []actionmanager.Action, dataConverter dataconverter.DataRead, deviceID string)

ExecuteSchedule is responsible for scheduling the operations

type ScheduleResult

type ScheduleResult struct {
	EventName   string
	TimeStamp   int64
	EventResult string
}

ScheduleResult structure contains the format in which telemetry data will be published on the MQTT topic

type Scheduler

type Scheduler struct {
	Schedules []Schedule `yaml:"schedules" json:"schedules"`
}

Scheduler structure contains the list of schedules to be scheduled

Jump to

Keyboard shortcuts

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