Move all types in tcpclient to types.go
This commit is contained in:
parent
ecb6e12425
commit
b26b0512f2
|
@ -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()
|
||||
|
||||
|
|
38
tcpclient/types.go
Normal file
38
tcpclient/types.go
Normal file
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user