diff --git a/tcpclient/client.go b/tcpclient/client.go index 7c8972a..c44a85e 100644 --- a/tcpclient/client.go +++ b/tcpclient/client.go @@ -11,17 +11,6 @@ import ( "git.qowevisa.me/Qowevisa/tcpmachine/tcpcommand" ) -type ClientConfiguration struct { - MessageEndRune rune - MessageSplitRune rune - // - Status uint32 - ErrorResolver func(chan error) - // - ServerHandlerFunc func(server net.Conn) - // -} - func GetDefaultConfig() *ClientConfiguration { return &ClientConfiguration{ MessageEndRune: '\n', @@ -34,26 +23,6 @@ func GetDefaultConfig() *ClientConfiguration { } } -type ErrorResolverFunc func(errors chan error) - -type Client struct { - MessageEndRune rune - MessageSplitRune rune - // - addr string - Status uint32 - exit chan bool - Server net.Conn - IsConnected bool - // - ServerHandlerFunc func(server net.Conn) - // - ErrorsChannel chan error - ErrorResolver ErrorResolverFunc - // - Commands []tcpcommand.Command -} - func CreateClient(addr string, options ...ClientOption) *Client { conf := GetDefaultConfig() diff --git a/tcpclient/types.go b/tcpclient/types.go new file mode 100644 index 0000000..03b83c1 --- /dev/null +++ b/tcpclient/types.go @@ -0,0 +1,38 @@ +package tcpclient + +import ( + "net" + + "git.qowevisa.me/Qowevisa/tcpmachine/tcpcommand" +) + +type ClientConfiguration struct { + MessageEndRune rune + MessageSplitRune rune + // + Status uint32 + ErrorResolver func(chan error) + // + ServerHandlerFunc func(server net.Conn) + // +} + +type ErrorResolverFunc func(errors chan error) + +type Client struct { + MessageEndRune rune + MessageSplitRune rune + // + addr string + Status uint32 + exit chan bool + Server net.Conn + IsConnected bool + // + ServerHandlerFunc func(server net.Conn) + // + ErrorsChannel chan error + ErrorResolver ErrorResolverFunc + // + Commands []tcpcommand.Command +}