Documentation ¶
Index ¶
- func GetKey(entityType string, keyPart ...string) string
- type Event
- type Manager
- func (store Manager) AddEvent(eventtype, details string, ip string, expiresafter time.Duration) (Event, error)
- func (store Manager) Close() error
- func (store Manager) GetAllEvents() ([]Event, error)
- func (store Manager) GetConfig() (SystemConfig, error)
- func (store Manager) GetEvent(id string) (Event, error)
- func (store Manager) SetConfig(updatedConfig SystemConfig) (SystemConfig, error)
- type SystemConfig
- type WebSocketResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶ added in v1.0.36
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, Config update, System shutdown, etc Details string `json:"details"` // Additional information (like the config information 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.36
func (store Manager) AddEvent(eventtype, details string, ip string, expiresafter time.Duration) (Event, error)
AddEvent adds an event to the system
func (Manager) GetAllEvents ¶ added in v1.0.36
GetAllEvents gets all events in the system
func (Manager) GetConfig ¶
func (store Manager) GetConfig() (SystemConfig, error)
GetConfig gets a config item from the system
func (Manager) SetConfig ¶
func (store Manager) SetConfig(updatedConfig SystemConfig) (SystemConfig, error)
SetConfig sets a config item to the system
type SystemConfig ¶ added in v1.0.69
type SystemConfig struct { ZipCode int `json:"zipcode"` UseZipCodeForLocation bool `json:"useZipcodeForLocation"` RadarStation string `json:"radarStation"` Location string `json:"location"` CalendarURL string `json:"calendarUrl"` CalendarTimeZone string `json:"calendarTimezone"` WifiSSID string `json:"wifiSSID"` WifiPassword string `json:"wifiPassword"` }
type WebSocketResponse ¶
type WebSocketResponse struct { Type string `json:"type"` Data interface{} `json:"data"` }
WebSocketResponse represents a WebSocket event response
Click to show internal directories.
Click to hide internal directories.