api

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Index

Constants

View Source
const (
	// the protocol type supported
	ProtocolTypeQuic = "quic"
	ProtocolTypeWS   = "websocket"

	// connection stat
	StatConnected    = "connected"
	StatDisconnected = "disconnected"

	// connection use type
	// connection only for message
	UseTypeMessage UseType = "msg"
	// connection only for stream
	UseTypeStream UseType = "str"
	// connection only can be used for message and stream
	UseTypeShare UseType = "shr"

	// the length of use type
	UseLen = len(UseTypeMessage)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QuicClientOption

type QuicClientOption struct {
	// send heads after connection completed using control stream
	// TODO:
	Header http.Header
	// the max incoming stream
	MaxIncomingStreams int
}

quic client option extend options when you using quic in client

type QuicServerOption

type QuicServerOption struct {
	// the max incoming stream
	MaxIncomingStreams int
}

quic server option including the extend options when getting server instance we can add the essential option into

type UseType

type UseType string

type WSClientCallback

type WSClientCallback func(*websocket.Conn, *http.Response)

you can do some additional processes after successful dialing

type WSClientOption

type WSClientOption struct {
	// extend headers that you want to input
	Header http.Header
	// called after dialing
	Callback WSClientCallback
}

websocket client options extend options when you using websocket in client

type WSFilterFunc

type WSFilterFunc func(w http.ResponseWriter, r *http.Request) bool

the filter function before upgrading the http to websocket

type WSServerOption

type WSServerOption struct {
	// the path that the client dialing
	Path string
	// the necessary processing before upgrading
	Filter WSFilterFunc
}

websocket server option you can add the extend options when getting websocket server instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL