From 8b15dea700da4e6a9e28d4ab6c1d2275efa3f2e6 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Thu, 9 Feb 2017 10:32:15 -0700 Subject: [PATCH] exposed base net.Conn to interface --- redcon.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redcon.go b/redcon.go index 81b27a4..8d74ae1 100644 --- a/redcon.go +++ b/redcon.go @@ -88,6 +88,8 @@ type Conn interface { // PeekPipeline returns all commands in current pipeline, if any. // The commands remain in the pipeline. PeekPipeline() []Command + // NetConn returns the base net.Conn connection + NetConn() net.Conn } // NewServer returns a new Redcon server configured on "tcp" network net. @@ -309,6 +311,9 @@ func (c *conn) ReadPipeline() []Command { func (c *conn) PeekPipeline() []Command { return c.cmds } +func (c *conn) NetConn() net.Conn { + return c.conn +} // BaseWriter returns the underlying connection writer, if any func BaseWriter(c Conn) *Writer {