summaryrefslogtreecommitdiffstats
path: root/ping.go
diff options
context:
space:
mode:
Diffstat (limited to 'ping.go')
-rw-r--r--ping.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/ping.go b/ping.go
new file mode 100644
index 0000000..48294ea
--- /dev/null
+++ b/ping.go
@@ -0,0 +1,19 @@
+package goctl
+
+type cmdPing struct{}
+
+func (cmd *cmdPing) Name() string {
+ return "ping"
+}
+
+func (cmd cmdPing) Help() string {
+ return "checks whether the connection is working"
+}
+
+func (cmd *cmdPing) Run(_ *Goctl, _ []string) string {
+ return "pong"
+}
+
+func init() {
+ builtinHandlers = append(builtinHandlers, &cmdPing{})
+}