websocket_fasthttp/client/socket_builder.go

38 lines
780 B
Go
Raw Permalink Normal View History

2017-11-30 03:15:05 +00:00
package client
import (
"crypto/tls"
"net"
"net/http"
"net/url"
"time"
cuc "git.loafle.net/commons_go/util/context"
)
type SocketBuilder interface {
SocketContext(parent cuc.Context) SocketContext
2017-12-08 07:41:43 +00:00
GetSocketHandler() SocketHandler
2017-12-01 04:00:40 +00:00
GetURL() string
2017-11-30 03:15:05 +00:00
GetRequestCookie() http.CookieJar
GetRequestHeader() http.Header
GetSubProtocols() []string
IsEnableCompression() bool
UseProxy(req *http.Request) (*url.URL, error)
GetHandshakeTimeout() time.Duration
Dial(network, addr string) (net.Conn, error)
GetTLSConfig() *tls.Config
GetReadBufferSize() int
GetWriteBufferSize() int
// Validate is check handler value
// If you override ths method, must call
//
// func (sh *SocketHandlers) Validate() {
// sh.SocketHandlers.Validate()
// ...
// }
Validate()
}