Skip to content

Commit

Permalink
endpoint: changed String to ColorString and add "normal" String
Browse files Browse the repository at this point in the history
Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm authored and tgraf committed Mar 22, 2017
1 parent bb7b217 commit 883b211
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/endpoint/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Status struct {
Type StatusType `json:"status-type"`
}

func (sc StatusCode) String() string {
func (sc StatusCode) ColorString() string {
var text string
switch sc {
case OK:
Expand All @@ -66,6 +66,21 @@ func (sc StatusCode) String() string {
return fmt.Sprintf("%s", text)
}

func (sc StatusCode) String() string {
switch sc {
case OK:
return "OK"
case Warning:
return "Warning"
case Failure:
return "Failure"
case Disabled:
return "Disabled"
default:
return "Unknown code"
}
}

func (s Status) String() string {
if s.Msg == "" {
return fmt.Sprintf("%s", s.Code)
Expand Down

0 comments on commit 883b211

Please sign in to comment.