2020-04-06 01:00:33 +00:00
|
|
|
package websocket
|
|
|
|
|
|
|
|
const (
|
|
|
|
AuthenticationSuccessEvent = "auth success"
|
|
|
|
TokenExpiringEvent = "token expiring"
|
|
|
|
TokenExpiredEvent = "token expired"
|
|
|
|
AuthenticationEvent = "auth"
|
|
|
|
SetStateEvent = "set state"
|
|
|
|
SendServerLogsEvent = "send logs"
|
|
|
|
SendCommandEvent = "send command"
|
|
|
|
ErrorEvent = "daemon error"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Message struct {
|
2020-09-13 05:12:23 +00:00
|
|
|
// The event to perform.
|
2020-04-06 01:00:33 +00:00
|
|
|
Event string `json:"event"`
|
|
|
|
|
|
|
|
// The data to pass along, only used by power/command currently. Other requests
|
|
|
|
// should either omit the field or pass an empty value as it is ignored.
|
|
|
|
Args []string `json:"args,omitempty"`
|
|
|
|
}
|