epoll

package
v0.0.0-...-3d0ed7e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptor

type Acceptor interface {
	GetLinkChan() chan road.Link
}

type AcceptorOption

type AcceptorOption func(*acceptorOptions)

func WithLinkChanSize

func WithLinkChanSize(size int) AcceptorOption

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(accept Acceptor, opts ...AppOption) *App

func (*App) Documentation

func (my *App) Documentation(getPtrNames bool) (map[string]interface{}, error)

Documentation returns handler and remotes docum/7entacion

func (*App) OnHandShaken

func (my *App) OnHandShaken(handler func(session road.Session))

OnHandShaken 暴露一个OnConnected()事件暂时没有看到很大的意义,因为handshake必须是第一个消息 如果需要接入握手事件的话, 可以自己注册OnHandShaken事件

func (*App) Register

func (my *App) Register(comp component.Component, opts ...component.Option) error

type AppOption

type AppOption func(*appOptions)

func WithHeartbeatInterval

func WithHeartbeatInterval(interval time.Duration) AppOption

func WithSerde

func WithSerde(serde serde.Serde) AppOption

func WithSessionRateLimitBySecond

func WithSessionRateLimitBySecond(limit int) AppOption

type IServeMux

type IServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}

type TcpAcceptor

type TcpAcceptor struct {
	// contains filtered or unexported fields
}

func NewTcpAcceptor

func NewTcpAcceptor(address string, opts ...AcceptorOption) *TcpAcceptor

func (*TcpAcceptor) Close

func (my *TcpAcceptor) Close() error

func (*TcpAcceptor) GetLinkChan

func (my *TcpAcceptor) GetLinkChan() chan road.Link

type WsAcceptor

type WsAcceptor struct {
	// contains filtered or unexported fields
}

func NewWsAcceptor

func NewWsAcceptor(serveMux IServeMux, servePath string, opts ...AcceptorOption) *WsAcceptor

func (*WsAcceptor) GetLinkChan

func (my *WsAcceptor) GetLinkChan() chan road.Link

func (*WsAcceptor) ServeHTTP

func (my *WsAcceptor) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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