add functional variant of Client
@@ -13,6 +13,12 @@ type Client interface {
Do(encoding.Marshaler) (*Response, error)
}
+// ClientFunc is a functional variant (and implementation) of the Client interface
+type ClientFunc func(encoding.Marshaler) (*Response, error)
+
+// Do implements Client
+func (cf ClientFunc) Do(m encoding.Marshaler) (*Response, error) { return cf(m) }
+
// Response captures the output of a Mesos API operation. Callers are responsible for invoking
// Close when they're finished processing the response otherwise there may be connection leaks.
type Response interface {
