Documentation ¶
Index ¶
- Variables
- func ListenAndServe(addr string, handler TCPHandler) error
- type Conn
- type HandleFunc
- type KuloyClient
- type TCPHandler
- type TailService
- type TcpHandlerFunc
- type TcpServer
- type TcpSliceGroup
- type TcpSliceRouter
- type TcpSliceRouterContext
- func (c *TcpSliceRouterContext) Abort()
- func (c *TcpSliceRouterContext) Get(key interface{}) interface{}
- func (c *TcpSliceRouterContext) GetClientConn() *Conn
- func (c *TcpSliceRouterContext) GetConn() net.Conn
- func (c *TcpSliceRouterContext) GetString(key interface{}) string
- func (c *TcpSliceRouterContext) IsAborted() bool
- func (c *TcpSliceRouterContext) Next()
- func (c *TcpSliceRouterContext) Read(key interface{}) interface{}
- func (c *TcpSliceRouterContext) Reset()
- func (c *TcpSliceRouterContext) Set(key, val interface{})
- func (c *TcpSliceRouterContext) Write(bytes []byte) error
- type TcpSliceRouterHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerClosed = errors.New("tcp: Server closed") ErrAbortHandler = errors.New("tcp: abort TCPHandler") ServerContextKey = "tcp-server" LocalAddrContextKey = "local-addr" RemoteAddrContextKey = "remote-addr" ForwardAddrContextKey = "forward-addr" ConnContextKey = "Conn" ClientConntKey = "client-conn" )
Functions ¶
func ListenAndServe ¶
func ListenAndServe(addr string, handler TCPHandler) error
Types ¶
type Conn ¶
type Conn struct { // Record remote ip KuloyClient // contains filtered or unexported fields }
type HandleFunc ¶
HandleFunc represents application handler function
type KuloyClient ¶
type KuloyClient struct {
// contains filtered or unexported fields
}
func (*KuloyClient) GetSelectedDB ¶
func (kc *KuloyClient) GetSelectedDB() int
func (*KuloyClient) SetSelectedDB ¶
func (kc *KuloyClient) SetSelectedDB(dbNum int)
type TCPHandler ¶
TCPHandler represents application handler over tcp
type TailService ¶
type TailService struct {
// contains filtered or unexported fields
}
func NewTailService ¶
func NewTailService(c *TcpSliceRouterContext) *TailService
type TcpHandlerFunc ¶
type TcpHandlerFunc func(*TcpSliceRouterContext)
type TcpServer ¶
type TcpServer struct { Addr string Handler TCPHandler WriteTimeout time.Duration ReadTimeout time.Duration KeepAliveTimeout time.Duration NotifyStarted func() // contains filtered or unexported fields }
func (*TcpServer) ListenAndServe ¶
type TcpSliceGroup ¶
type TcpSliceGroup struct { *TcpSliceRouter // contains filtered or unexported fields }
func (*TcpSliceGroup) Use ¶
func (g *TcpSliceGroup) Use(middlewares ...TcpHandlerFunc) *TcpSliceGroup
type TcpSliceRouter ¶
type TcpSliceRouter struct {
// contains filtered or unexported fields
}
func NewTcpSliceRouter ¶
func NewTcpSliceRouter() *TcpSliceRouter
func (*TcpSliceRouter) Group ¶
func (g *TcpSliceRouter) Group() *TcpSliceGroup
type TcpSliceRouterContext ¶
type TcpSliceRouterContext struct { Ctx context.Context *TcpSliceGroup // contains filtered or unexported fields }
func (*TcpSliceRouterContext) Abort ¶
func (c *TcpSliceRouterContext) Abort()
func (*TcpSliceRouterContext) Get ¶
func (c *TcpSliceRouterContext) Get(key interface{}) interface{}
func (*TcpSliceRouterContext) GetClientConn ¶
func (c *TcpSliceRouterContext) GetClientConn() *Conn
func (*TcpSliceRouterContext) GetConn ¶
func (c *TcpSliceRouterContext) GetConn() net.Conn
func (*TcpSliceRouterContext) GetString ¶
func (c *TcpSliceRouterContext) GetString(key interface{}) string
func (*TcpSliceRouterContext) IsAborted ¶
func (c *TcpSliceRouterContext) IsAborted() bool
func (*TcpSliceRouterContext) Next ¶
func (c *TcpSliceRouterContext) Next()
func (*TcpSliceRouterContext) Read ¶
func (c *TcpSliceRouterContext) Read(key interface{}) interface{}
func (*TcpSliceRouterContext) Reset ¶
func (c *TcpSliceRouterContext) Reset()
func (*TcpSliceRouterContext) Set ¶
func (c *TcpSliceRouterContext) Set(key, val interface{})
func (*TcpSliceRouterContext) Write ¶
func (c *TcpSliceRouterContext) Write(bytes []byte) error
type TcpSliceRouterHandler ¶
type TcpSliceRouterHandler struct {
// contains filtered or unexported fields
}
func NewTcpSliceRouterHandler ¶
func NewTcpSliceRouterHandler(coreFunc func(*TcpSliceRouterContext) TCPHandler, router *TcpSliceRouter) *TcpSliceRouterHandler
Click to show internal directories.
Click to hide internal directories.