Documentation
¶
Index ¶
- Constants
- Variables
- func NewTcpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *tcpAgent
- func NewTcpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer
- func NewTcpListener(addr string, onConn func(conn net.Conn)) kiwi.IListener
- func NewUdpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *udpAgent
- func NewUdpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer
- func NewUdpListener(addr string, onConn func(conn net.Conn)) kiwi.IListener
- func NewWebAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *webAgent
- func NewWebDialer(name, url string, header http.Header, receiver kiwi.FnAgentBytes, ...) kiwi.IDialer
- func NewWebListener(addr string, onConn func(conn *websocket.Conn), opt *kiwi.GateWsOption) kiwi.IListener
- type HttpAgent
- func (a HttpAgent) Addr() string
- func (a *HttpAgent) BindConnected(fn kiwi.FnAgent)
- func (a *HttpAgent) BindDisconnected(fn kiwi.FnAgentErr)
- func (a HttpAgent) ClearSession()
- func (a HttpAgent) CopySession(m util.M)
- func (a HttpAgent) DelSession(keys []string, updated util.M)
- func (a HttpAgent) EConn() kiwi.EConn
- func (a HttpAgent) GetSession(key string) (val any, exist bool)
- func (a HttpAgent) Host() string
- func (a HttpAgent) Id() string
- func (a HttpAgent) SetId(id string)
- func (a HttpAgent) SetSession(update, updated util.M)
- func (a HttpAgent) SetSessionVal(key string, val any)
- func (a *HttpAgent) Start()
- func (a HttpAgent) UpdateAddr(addr string)
- func (a *HttpAgent) UpdateTimestamp()
- type HttpDialer
- type HttpListener
Constants ¶
Variables ¶
View Source
var (
MsgType = 2
)
Functions ¶
func NewTcpAgent ¶
func NewTcpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *tcpAgent
NewTcpAgent receiver接收字节如果使用异步方式需要copy一份,否则数据会被覆盖
func NewTcpDialer ¶
func NewTcpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer
func NewUdpAgent ¶
func NewUdpAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *udpAgent
func NewUdpDialer ¶
func NewUdpDialer(name, addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer
func NewWebAgent ¶
func NewWebAgent(addr string, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) *webAgent
func NewWebDialer ¶
func NewWebDialer(name, url string, header http.Header, receiver kiwi.FnAgentBytes, options ...kiwi.AgentOption) kiwi.IDialer
Types ¶
type HttpAgent ¶
type HttpAgent struct {
// contains filtered or unexported fields
}
func NewHttpAgent ¶
func NewHttpAgent(addr string, opts ...kiwi.AgentOption) *HttpAgent
func (*HttpAgent) BindDisconnected ¶
func (a *HttpAgent) BindDisconnected(fn kiwi.FnAgentErr)
func (HttpAgent) ClearSession ¶
func (a HttpAgent) ClearSession()
type HttpDialer ¶
type HttpDialer struct {
// contains filtered or unexported fields
}
func NewHttpDialer ¶
func NewHttpDialer(host string) *HttpDialer
func (*HttpDialer) Host ¶
func (a *HttpDialer) Host() string
func (*HttpDialer) SetHost ¶
func (a *HttpDialer) SetHost(host string)
type HttpListener ¶
type HttpListener struct {
// contains filtered or unexported fields
}
func NewHttpListener ¶
func NewHttpListener(addr string, handlers []kiwi.IHttpHandler) *HttpListener
func (*HttpListener) Addr ¶
func (l *HttpListener) Addr() string
func (*HttpListener) Close ¶
func (l *HttpListener) Close()
func (*HttpListener) Port ¶
func (l *HttpListener) Port() int
func (*HttpListener) Start ¶
func (l *HttpListener) Start() *util.Err
Source Files
¶
- agent.go
- http_agent.go
- http_dialer.go
- http_listener.go
- socket_agent.go
- tcp_agent.go
- tcp_dialer.go
- tcp_listener.go
- udp_agent.go
- udp_dialer.go
- udp_listener.go
- web_agent.go
- web_dialer.go
- web_listener.go
Click to show internal directories.
Click to hide internal directories.