Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // common options Options // client type ConnUse api.UseType // consumer for raw data Consumer io.Writer // extend options ExOpts interface{} // contains filtered or unexported fields }
client including common options and extend options
type Options ¶
type Options struct { // protocol type Type string // the addr or url Addr string // client type ConnUse api.UseType // used to configure a TLS client TLSConfig *tls.Config // the message will route to Handler automatically if AutoRoute is true Handler mux.Handler // auto route flag AutoRoute bool // HandshakeTimeout is the maximum duration that the cryptographic handshake may take. HandshakeTimeout time.Duration // consumer for raw data Consumer io.Writer }
the common options of client
type ProtocolClient ¶
type ProtocolClient interface {
Connect() (conn.Connection, error)
}
protocol client each protocol(websocket/quic) provide Connect
type QuicClient ¶
type QuicClient struct {
// contains filtered or unexported fields
}
the client based on quic
func NewQuicClient ¶
func NewQuicClient(opts Options, exOpts interface{}) *QuicClient
new a quic client instance
func (*QuicClient) Connect ¶
func (c *QuicClient) Connect() (conn.Connection, error)
try to dial server and get connection interface for operations
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
the client based on websocket
func NewWSClient ¶
new websocket client instance
Click to show internal directories.
Click to hide internal directories.