Documentation
¶
Index ¶
- Constants
- func NewPollingTransport(chanBuf int) func(SessionID, Codec) Transporter
- func NewWebsocketTransport(chanBuf int) func(SessionID, Codec) Transporter
- type Codec
- type HTTPCompressionKind
- type Name
- type Option
- func OnInitProbe(b bool) Option
- func OnUpgrade(fn func() error) Option
- func WithBufferedReader() Option
- func WithCodec(codec Codec) Option
- func WithGovernor(minTime, sleep time.Duration) Option
- func WithHTTPCompression(kind HTTPCompressionKind) Option
- func WithNoPing() Option
- func WithPerMessageDeflate(kind HTTPCompressionKind) Option
- func WithPollingSleep(d time.Duration) Option
- type OptionWith
- type PollingTransport
- type SessionID
- type StartWriteBuffer
- type Transport
- type Transporter
- type WaitGroup
- type WebsocketTransport
- type WriteClose
Constants ¶
View Source
const ( ErrDecodeFailed erro.StringF = "failed to decode the %q transport:: %w" ErrEncodeFailed erro.StringF = "failed to encode the %q transport:: %w" ErrUnimplementedMethod erro.StringF = "unimplemented %s method" ErrCloseSocket erro.State = "socket: closed" ErrTimeoutSocket erro.State = "socket: timeout" )
Variables ¶
This section is empty.
Functions ¶
func NewPollingTransport ¶
func NewPollingTransport(chanBuf int) func(SessionID, Codec) Transporter
func NewWebsocketTransport ¶
func NewWebsocketTransport(chanBuf int) func(SessionID, Codec) Transporter
Types ¶
type Codec ¶
type Codec struct { eiop.PacketEncoder eiop.PacketDecoder eiop.PayloadEncoder eiop.PayloadDecoder }
type HTTPCompressionKind ¶
type HTTPCompressionKind string
const (
CompressGZIP HTTPCompressionKind = "gzip"
)
type Option ¶
func OnInitProbe ¶
func WithBufferedReader ¶
func WithBufferedReader() Option
func WithGovernor ¶
func WithHTTPCompression ¶
func WithHTTPCompression(kind HTTPCompressionKind) Option
func WithNoPing ¶
func WithNoPing() Option
func WithPerMessageDeflate ¶
func WithPerMessageDeflate(kind HTTPCompressionKind) Option
func WithPollingSleep ¶
type OptionWith ¶
type OptionWith = with.OptionWith
type PollingTransport ¶
type PollingTransport struct { *Transport // contains filtered or unexported fields }
func (*PollingTransport) InnerTransport ¶
func (t *PollingTransport) InnerTransport() *Transport
func (*PollingTransport) Run ¶
func (t *PollingTransport) Run(w http.ResponseWriter, r *http.Request, opts ...Option) (err error)
func (*PollingTransport) With ¶
func (t *PollingTransport) With(opts ...Option)
func (*PollingTransport) Write ¶
func (t *PollingTransport) Write(w http.ResponseWriter, r *http.Request) error
type StartWriteBuffer ¶
type StartWriteBuffer func() bool
func (StartWriteBuffer) Len ¶
func (StartWriteBuffer) Len() int
type Transporter ¶
type WebsocketTransport ¶
type WebsocketTransport struct { *Transport PingMsg string // contains filtered or unexported fields }
func (*WebsocketTransport) InnerTransport ¶
func (t *WebsocketTransport) InnerTransport() *Transport
func (*WebsocketTransport) Run ¶
func (t *WebsocketTransport) Run(w http.ResponseWriter, r *http.Request, opts ...Option) (err error)
func (*WebsocketTransport) With ¶
func (t *WebsocketTransport) With(opts ...Option)
type WriteClose ¶
type WriteClose struct {
// contains filtered or unexported fields
}
func (WriteClose) SocketCloseChannel ¶
func (wc WriteClose) SocketCloseChannel() error
Click to show internal directories.
Click to hide internal directories.