Commit bc765e58 authored by Zhu Yong's avatar Zhu Yong
Browse files

add function to return StatusCode as string

parent 04d381dc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -98,6 +98,16 @@ var statusName = map[StatusCode]string{
	RemoteShutdown:                     "REMOTE_SHUTDOWN",
}

// String returns string value of StatusCode.
func (c StatusCode) String() string {
	str, ok := statusName[c]
	if ok {
		return str
	}

	return "Unknown Status"
}

// Status for each kinetic message.
// Code is the status code and ErrorMsg is the detail message
type Status struct {