Documentation ¶
Index ¶
- func HttpDeleteForm(client *http.Client, reqUrl string, postData url.Values, ...) ([]byte, error)
- func HttpGet(client *http.Client, reqUrl string) (map[string]interface{}, error)
- func HttpGet2(client *http.Client, reqUrl string, headers map[string]string) (map[string]interface{}, error)
- func HttpGet3(client *http.Client, reqUrl string, headers map[string]string) ([]interface{}, error)
- func HttpGet4(client *http.Client, reqUrl string, headers map[string]string, ...) error
- func HttpGet5(client *http.Client, reqUrl string, headers map[string]string) ([]byte, error)
- func HttpPostForm(client *http.Client, reqUrl string, postData url.Values) ([]byte, error)
- func HttpPostForm2(client *http.Client, reqUrl string, postData url.Values, ...) ([]byte, error)
- func HttpPostForm3(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)
- func HttpPostForm4(client *http.Client, reqUrl string, postData map[string]string, ...) ([]byte, error)
- func HttpPut(client *http.Client, reqUrl string, postData url.Values, ...) ([]byte, error)
- func NewHttpRequest(client *http.Client, reqType string, reqUrl string, postData string, ...) ([]byte, error)
- func NewHttpRequestWithFasthttp(client *http.Client, reqMethod, reqUrl, postData string, ...) ([]byte, error)
- type WsBuilder
- func (b *WsBuilder) AutoReconnect() *WsBuilder
- func (b *WsBuilder) Build() *WsConn
- func (b *WsBuilder) ConnectSuccessAfterSendMessage(msg func() []byte) *WsBuilder
- func (b *WsBuilder) DecompressFunc(f func([]byte) ([]byte, error)) *WsBuilder
- func (b *WsBuilder) Dump() *WsBuilder
- func (b *WsBuilder) ErrorHandleFunc(f func(err error)) *WsBuilder
- func (b *WsBuilder) Heartbeat(heartbeat func() []byte, t time.Duration) *WsBuilder
- func (b *WsBuilder) ProtoHandleFunc(f func([]byte) error) *WsBuilder
- func (b *WsBuilder) ProxyUrl(proxyUrl string) *WsBuilder
- func (b *WsBuilder) ReconnectInterval(t time.Duration) *WsBuilder
- func (b *WsBuilder) ReqHeader(key, value string) *WsBuilder
- func (b *WsBuilder) WsUrl(wsUrl string) *WsBuilder
- type WsConfig
- type WsConn
- func (ws *WsConn) CloseWs()
- func (ws *WsConn) NewWs() *WsConn
- func (ws *WsConn) SendCloseMessage(msg []byte)
- func (ws *WsConn) SendJsonMessage(m interface{}) error
- func (ws *WsConn) SendMessage(msg []byte)
- func (ws *WsConn) SendPingMessage(msg []byte)
- func (ws *WsConn) SendPongMessage(msg []byte)
- func (ws *WsConn) Subscribe(subEvent interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpDeleteForm ¶
func HttpPostForm ¶
func HttpPostForm2 ¶
func HttpPostForm3 ¶
func HttpPostForm4 ¶
func NewHttpRequest ¶
Types ¶
type WsBuilder ¶
type WsBuilder struct {
// contains filtered or unexported fields
}
func NewWsBuilder ¶
func NewWsBuilder() *WsBuilder
func (*WsBuilder) AutoReconnect ¶
func (*WsBuilder) ConnectSuccessAfterSendMessage ¶
func (*WsBuilder) DecompressFunc ¶
func (*WsBuilder) ErrorHandleFunc ¶
func (*WsBuilder) ProtoHandleFunc ¶
func (*WsBuilder) ReconnectInterval ¶
type WsConfig ¶
type WsConfig struct { WsUrl string ProxyUrl string ReqHeaders map[string][]string //连接的时候加入的头部信息 HeartbeatIntervalTime time.Duration // HeartbeatData func() []byte //心跳数据2 IsAutoReconnect bool ProtoHandleFunc func([]byte) error //协议处理函数 DecompressFunc func([]byte) ([]byte, error) //解压函数 ErrorHandleFunc func(err error) ConnectSuccessAfterSendMessage func() []byte //for reconnect IsDump bool // contains filtered or unexported fields }
type WsConn ¶
type WsConn struct { WsConfig // contains filtered or unexported fields }
func (*WsConn) SendCloseMessage ¶
func (*WsConn) SendJsonMessage ¶
func (*WsConn) SendMessage ¶
func (*WsConn) SendPingMessage ¶
func (*WsConn) SendPongMessage ¶
Click to show internal directories.
Click to hide internal directories.