From 14c6c265268ada77e182914c489e29762aafaac0 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 12 Feb 2013 08:42:15 -0800 Subject: [PATCH] Added comments to rcli Upstream-commit: abb7b81b130ce9ddbb93a962b4ed84af6654e226 Component: engine --- components/engine/rcli/tcp.go | 3 +++ components/engine/rcli/types.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/components/engine/rcli/tcp.go b/components/engine/rcli/tcp.go index 7aa228afc9..0a06d459ce 100644 --- a/components/engine/rcli/tcp.go +++ b/components/engine/rcli/tcp.go @@ -53,6 +53,9 @@ func ListenAndServe(proto, addr string, service Service) error { return nil } + +// Parse an rcli call on a new connection, and pass it to `service` if it +// is valid. func Serve(conn io.ReadWriter, service Service) error { r := bufio.NewReader(conn) var args []string diff --git a/components/engine/rcli/types.go b/components/engine/rcli/types.go index b36aa75e8c..10a2938f37 100644 --- a/components/engine/rcli/types.go +++ b/components/engine/rcli/types.go @@ -1,5 +1,12 @@ package rcli +// rcli (Remote Command-Line Interface) is a simple protocol for... +// serving command-line interfaces remotely. +// +// rcli can be used over any transport capable of a) sending binary streams in +// both directions, and b) capable of half-closing a connection. TCP and Unix sockets +// are the usual suspects. + import ( "fmt" "io"