Documentation ¶
Index ¶
- func GetKey(entityType string, keyPart ...string) string
- type ChannelValue
- type Event
- type Manager
- func (store Manager) AddEvent(eventtype, details string, ip string, expiresafter time.Duration) (Event, error)
- func (store Manager) AddTimeline(name, devpath string, frames []TimelineFrame) (Timeline, error)
- func (store Manager) Close() error
- func (store Manager) DeleteTimeline(id string) error
- func (store Manager) GetAllEvents() ([]Event, error)
- func (store Manager) GetAllTimelines() ([]Timeline, error)
- func (store Manager) GetDefaultUSBDev() (string, error)
- func (store Manager) GetEvent(id string) (Event, error)
- func (store Manager) GetTimeline(id string) (Timeline, error)
- func (store Manager) UpdateDefaultUSBDev(updatedDefaultDev string) (string, error)
- func (store Manager) UpdateTimeline(updatedTimeline Timeline) (Timeline, error)
- type Timeline
- type TimelineFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelValue ¶ added in v1.0.10
type Event ¶ added in v1.0.20
type Event struct { ID string `json:"id"` // Unique Event ID Created time.Time `json:"created"` // Event creation time SourceIP string `json:"ip"` // Source IP address of the event EventType string `json:"eventtype"` // One of: System startup, Timeline created, Timeline started, System shutdown, etc Details string `json:"details"` // Additional information (like the timeline name involved) }
Event represents an event in the system. These events can be logged or passed (as meta information) to other systems
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the data manager
func NewManager ¶
NewManager creates a new instance of a Manager and returns it
func (Manager) AddEvent ¶ added in v1.0.20
func (store Manager) AddEvent(eventtype, details string, ip string, expiresafter time.Duration) (Event, error)
AddEvent adds an event to the system
func (Manager) AddTimeline ¶ added in v1.0.10
func (store Manager) AddTimeline(name, devpath string, frames []TimelineFrame) (Timeline, error)
AddTimeline adds a timeline to the system
func (Manager) DeleteTimeline ¶ added in v1.0.12
DeleteTimeline deletes a timeline from the system
func (Manager) GetAllEvents ¶ added in v1.0.20
GetAllEvents gets all events in the system
func (Manager) GetAllTimelines ¶ added in v1.0.12
GetAllTimelines gets all timelines in the system
func (Manager) GetDefaultUSBDev ¶ added in v1.0.34
GetDefaultUSBDev gets the default usb device to use. If not set, it attempt to set it first. Returns an error if it can't be fetched or set
func (Manager) GetTimeline ¶ added in v1.0.12
GetTimeline gets information about a single timeline in the system based on its id
func (Manager) UpdateDefaultUSBDev ¶ added in v1.0.34
UpdateDefaultUSBDev updates the default usb device to use
type Timeline ¶ added in v1.0.12
type Timeline struct { ID string `json:"id"` // Unique Timeline ID Enabled bool `json:"enabled"` // Timeline enabled or not Created time.Time `json:"created"` // Timeline create time Name string `json:"name"` // Timeline name USBDevicePath string `json:"devpath,omitempty"` // The USB device to play the timeline on. Optional. If not set, uses the default Frames []TimelineFrame `json:"frames"` // Frames for the timeline }
type TimelineFrame ¶ added in v1.0.12
type TimelineFrame struct { Type string `json:"type"` // Timeline frame type (scene/sleep/fade) Fade 'fades' between the previous channel state and this frame Channels []ChannelValue `json:"channels,omitempty"` // Channel information to set for the scene (optional) Required if type = scene or fade SleepTime int `json:"sleeptime"` // Sleep type in seconds (optional) Required if type = sleep }