forked from mirror/redcon
more comments
This commit is contained in:
parent
a04ea6b9f8
commit
dfd45719ec
15
redcon.go
15
redcon.go
|
@ -11,14 +11,29 @@ import (
|
||||||
|
|
||||||
// Conn represents a client connection
|
// Conn represents a client connection
|
||||||
type Conn interface {
|
type Conn interface {
|
||||||
|
// RemoteAddr returns the remote address of the client connection.
|
||||||
RemoteAddr() string
|
RemoteAddr() string
|
||||||
|
// Close closes the connection.
|
||||||
Close() error
|
Close() error
|
||||||
|
// WriteError writes an error to the client.
|
||||||
WriteError(msg string)
|
WriteError(msg string)
|
||||||
|
// WriteString writes a string to the client.
|
||||||
WriteString(str string)
|
WriteString(str string)
|
||||||
|
// WriteBulk writes a bulk string to the client.
|
||||||
WriteBulk(bulk string)
|
WriteBulk(bulk string)
|
||||||
|
// WriteInt writes an integer to the client.
|
||||||
WriteInt(num int)
|
WriteInt(num int)
|
||||||
|
// WriteArray writes an array header. You must then write addtional
|
||||||
|
// sub-responses to the client to complete the response.
|
||||||
|
// For example to write two strings:
|
||||||
|
//
|
||||||
|
// c.WriteArray(2)
|
||||||
|
// c.WriteBulk("item 1")
|
||||||
|
// c.WriteBulk("item 2")
|
||||||
WriteArray(count int)
|
WriteArray(count int)
|
||||||
|
// WriteNull writes a null to the client
|
||||||
WriteNull()
|
WriteNull()
|
||||||
|
// SetReadBuffer updates the buffer read size for the connection
|
||||||
SetReadBuffer(bytes int)
|
SetReadBuffer(bytes int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue