Initial import.
This commit is contained in:
17
cps/ping.go
Normal file
17
cps/ping.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package cps
|
||||
|
||||
func init() {
|
||||
Register("ping", pingHandler)
|
||||
}
|
||||
|
||||
// Ping just returns pong and is used to verify that the system is alive.
|
||||
func pingHandler(cmd *Command) (*Response, error) {
|
||||
message := "pong"
|
||||
if len(cmd.Args) > 0 {
|
||||
message += " (FYI, no additional args are used)"
|
||||
}
|
||||
|
||||
return &Response{
|
||||
Message: message,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user