Commit da6203c9 authored by Zhu Yong's avatar Zhu Yong Committed by GitHub
Browse files

Merge pull request #13 from yongzhy/master

add function to return StatusCode as string
parents 1348c655 bc765e58
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 {