summaryrefslogtreecommitdiff
path: root/src/rhctl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhctl')
-rw-r--r--src/rhctl/audio_switch.go18
-rw-r--r--src/rhctl/playout_server.go5
-rw-r--r--src/rhctl/switch_control.go5
3 files changed, 24 insertions, 4 deletions
diff --git a/src/rhctl/audio_switch.go b/src/rhctl/audio_switch.go
index a5c1a5c..f8c1cb1 100644
--- a/src/rhctl/audio_switch.go
+++ b/src/rhctl/audio_switch.go
@@ -34,8 +34,8 @@ const (
SwitchError
)
-func (c SwitchResult) String() string {
- switch c {
+func (r SwitchResult) String() string {
+ switch r {
case SwitchOK:
return "OK"
case SwitchError:
@@ -44,6 +44,11 @@ func (c SwitchResult) String() string {
return "unknown"
}
+func (r SwitchResult) MarshalText() (data []byte, err error) {
+ data = []byte(r.String())
+ return
+}
+
type SwitchResponse struct {
Result SwitchResult
Message string
@@ -59,8 +64,8 @@ const (
SwitchSilence
)
-func (c SwitchUpdateType) String() string {
- switch c {
+func (u SwitchUpdateType) String() string {
+ switch u {
case SwitchAudio:
return "audio"
case SwitchGPI:
@@ -75,6 +80,11 @@ func (c SwitchUpdateType) String() string {
return "unknown"
}
+func (u SwitchUpdateType) MarshalText() (data []byte, err error) {
+ data = []byte(u.String())
+ return
+}
+
type SwitchUpdate struct {
Type SwitchUpdateType
Data string
diff --git a/src/rhctl/playout_server.go b/src/rhctl/playout_server.go
index 2aca202..cc5f6bf 100644
--- a/src/rhctl/playout_server.go
+++ b/src/rhctl/playout_server.go
@@ -46,6 +46,11 @@ func (s ServerHealth) String() string {
return "unknown"
}
+func (s ServerHealth) MarshalText() (data []byte, err error) {
+ data = []byte(s.String())
+ return
+}
+
type ServerState struct {
Name string
Health ServerHealth
diff --git a/src/rhctl/switch_control.go b/src/rhctl/switch_control.go
index 235fd95..200bae7 100644
--- a/src/rhctl/switch_control.go
+++ b/src/rhctl/switch_control.go
@@ -85,6 +85,11 @@ func (c CommandType) String() string {
return "unknown"
}
+func (c CommandType) MarshalText() (data []byte, err error) {
+ data = []byte(c.String())
+ return
+}
+
type Command struct {
Type CommandType
Args []string