Documentation
¶
Overview ¶
Package lights provides ways to represent a set of lights
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds Set instances. The zero value is an empty Builder ready for use.
func NewBuilder ¶
NewBuilder returns a new instance with other as its initial contents.
type Map ¶
Map represents a map of virtual light Ids to physical light ids. When a light fails, its replacement will be given a new id. This data structure allows a light to keep the same virtual id in the marvin system even after replacing it. The key is the virtual light Id, the value is the physical light id. If there is no mapping for a virtual light id, it maps to itself. Map instances are to be treated as immutable.
type Set ¶
Set represents a set of positive light Ids. nil represents all lights; An empty map or a map containing only false values represents no lights. Callers should treat Set instances as immutable.
func Parse ¶
Parse parses comma separated light Ids as a Set. An empty string or a string with just spaces parses as all lights. Currently Parse will never return an instance representing no lights.
func (Set) OverlapsWith ¶
OverlapsWith returns true if this instance and other share common lights
func (Set) Slice ¶
Slice returns this instance as a slice of light ids sorted in ascending order and true. If this instance represents all lights, returns an empty slice and true. If this instance represents no lights, returns an empty slice and false.