summaryrefslogtreecommitdiff
path: root/cmd.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-22 22:18:48 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-22 22:18:48 -0500
commit640249036f58f79493c9c995f337fc9a2c67c6cb (patch)
treeeec6ade0cde6b41d2626f777a1f1d312330b279b /cmd.go
parentc4e844f390aaeabfc3ffe4e28457c8d0c84e934e (diff)
use an interface to avoid specifying *textproto.FIWriter everywhere
Diffstat (limited to 'cmd.go')
-rw-r--r--cmd.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd.go b/cmd.go
index 5e76708..4d56ad8 100644
--- a/cmd.go
+++ b/cmd.go
@@ -1,14 +1,15 @@
package libfastimport
-import (
- "git.lukeshu.com/go/libfastimport/textproto"
-)
-
type fiReader interface {
PeekLine() (string, error)
ReadLine() (string, error)
}
+type fiWriter interface {
+ WriteData(string) error
+ WriteLine(a ...interface{}) error
+}
+
type cmdClass int
const (
@@ -20,6 +21,6 @@ const (
type Cmd interface {
fiCmdRead(fiReader) (Cmd, error)
- fiCmdWrite(*textproto.FIWriter) error
+ fiCmdWrite(fiWriter) error
fiCmdClass() cmdClass
}