nplight

package
v0.0.0-...-6db7017 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeHeap

type ChangeHeap []LightChange

An ChangeHeap is a min-heap of LightChange.

func (ChangeHeap) Len

func (h ChangeHeap) Len() int

func (ChangeHeap) Less

func (h ChangeHeap) Less(i, j int) bool

func (ChangeHeap) Peek

func (h ChangeHeap) Peek() LightChange

func (*ChangeHeap) Pop

func (h *ChangeHeap) Pop() interface{}

func (*ChangeHeap) Push

func (h *ChangeHeap) Push(x interface{})

func (ChangeHeap) Swap

func (h ChangeHeap) Swap(i, j int)

type LightChange

type LightChange struct {
	Lights []uint32
	Time   time.Time
}

type LightPlan

type LightPlan struct {
	sync.Mutex
	ChangeHeap *ChangeHeap
}

func NewLightPlan

func NewLightPlan() LightPlan

func (LightPlan) Add

func (p LightPlan) Add(c LightChange)

func (LightPlan) Advance

func (p LightPlan) Advance() LightChange

func (LightPlan) Peek

func (p LightPlan) Peek() LightChange

type Subscriber

type Subscriber struct {
	services.Service

	Size      int
	LightPlan LightPlan
}

func NewSubscriber

func NewSubscriber(port int, domainPort int, logger *log.Logger, size int) *Subscriber

func (*Subscriber) DisplayLights

func (s *Subscriber) DisplayLights()

func (*Subscriber) Run

func (s *Subscriber) Run()

func (*Subscriber) SubscribeLights

func (s *Subscriber) SubscribeLights()

Jump to

Keyboard shortcuts

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