data

package
v1.0.42 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKey

func GetKey(entityType string, keyPart ...string) string

GetKey returns a key to be used in the storage system

Types

type ChannelValue added in v1.0.10

type ChannelValue struct {
	Channel int  `json:"channel"` // Unique Fixture ID
	Value   byte `json:"value"`   // Optional fixture name
}

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

func NewManager(systemdbpath string) (*Manager, error)

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

func (store Manager) Close() error

Close closes the data Manager

func (Manager) DeleteTimeline added in v1.0.12

func (store Manager) DeleteTimeline(id string) error

DeleteTimeline deletes a timeline from the system

func (Manager) GetAllEvents added in v1.0.20

func (store Manager) GetAllEvents() ([]Event, error)

GetAllEvents gets all events in the system

func (Manager) GetAllTimelines added in v1.0.12

func (store Manager) GetAllTimelines() ([]Timeline, error)

GetAllTimelines gets all timelines in the system

func (Manager) GetDefaultUSBDev added in v1.0.34

func (store Manager) GetDefaultUSBDev() (string, error)

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) GetEvent added in v1.0.20

func (store Manager) GetEvent(id string) (Event, error)

GetEvent gets an event from the system

func (Manager) GetTimeline added in v1.0.12

func (store Manager) GetTimeline(id string) (Timeline, error)

GetTimeline gets information about a single timeline in the system based on its id

func (Manager) UpdateDefaultUSBDev added in v1.0.34

func (store Manager) UpdateDefaultUSBDev(updatedDefaultDev string) (string, error)

UpdateDefaultUSBDev updates the default usb device to use

func (Manager) UpdateTimeline added in v1.0.12

func (store Manager) UpdateTimeline(updatedTimeline Timeline) (Timeline, error)

UpdateTimeline updates a timeline in the system

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
}

Jump to

Keyboard shortcuts

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