From 3efa1fc8a98d2d90c204c7bd5a0e2519e1ac7745 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Nov 2017 22:04:14 -0500 Subject: split the parser up, and have read methods like write emethods --- cmd.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd.go') diff --git a/cmd.go b/cmd.go index 7ba40e0..5e76708 100644 --- a/cmd.go +++ b/cmd.go @@ -4,6 +4,11 @@ import ( "git.lukeshu.com/go/libfastimport/textproto" ) +type fiReader interface { + PeekLine() (string, error) + ReadLine() (string, error) +} + type cmdClass int const ( @@ -14,6 +19,7 @@ const ( ) type Cmd interface { + fiCmdRead(fiReader) (Cmd, error) fiCmdWrite(*textproto.FIWriter) error fiCmdClass() cmdClass } -- cgit v1.2.3