engineio

package
v0.0.0-...-73e4950 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnknownTransport         = httpErrStr(erro.HTTPStatusError400 + "unknown transport")
	ErrUnknownSessionID         = httpErrStr(erro.HTTPStatusError400 + "unknown session id")
	ErrUnknownEIOVersion        = httpErrStr(erro.HTTPStatusError400 + "unknown engineio version")
	ErrInvalidRequestHTTPMethod = httpErrStr(erro.HTTPStatusError400 + "invalid request, an unimplemented HTTP method")
	ErrInvalidURIPath           = httpErrStr(erro.HTTPStatusError400 + "invalid URI path, the prefix is not found")
	ErrTransportUpgradeFailed   = httpErrStr(erro.HTTPStatusError400 + "failed to upgrade transport")

	EOH erro.State = "End Of Handshake"
	IOR erro.State = "Is OPTION Request"
)

Variables

This section is empty.

Functions

func NewSessions

func NewSessions() *sessions

func ToEOH

func ToEOH(err error) error

Types

type CORScredentials

type CORScredentials bool

type CORSenable

type CORSenable bool

type CORSheadersAllow

type CORSheadersAllow []string

type CORSheadersExpose

type CORSheadersExpose []string

type CORSmaxAge

type CORSmaxAge int

type CORSmethods

type CORSmethods []string

type CORSoptionsSuccessStatus

type CORSoptionsSuccessStatus int

type CORSorigin

type CORSorigin []string

type EIOServer

type EIOServer interface {
	Server
	ServeTransport(http.ResponseWriter, *http.Request) (eiot.Transporter, error)
}

type EIOVersionInt

type EIOVersionInt int

type EIOVersionStr

type EIOVersionStr string
const Version2 EIOVersionStr = "2"
const Version3 EIOVersionStr = "3"
const Version4 EIOVersionStr = "4"
const Version5 EIOVersionStr = "5"

func (EIOVersionStr) Int

func (v EIOVersionStr) Int() EIOVersionInt

type Option

type Option = with.Option

func WithCodec

func WithCodec(codec eiot.Codec) Option

func WithCookie

func WithCookie(name, path string, httpOnly bool) Option

func WithCors

func WithCors(opts ...corsOption) Option

func WithGenerateIDFunc

func WithGenerateIDFunc(fn func() SessionID) Option

func WithInitialPackets

func WithInitialPackets(fn func(eiot.Transporter, *http.Request)) Option

func WithMaxPayload

func WithMaxPayload(n int) Option

func WithPath

func WithPath(path string) Option

WithPath could be accessed from SocketIO engine,

func WithPingInterval

func WithPingInterval(d time.Duration) Option

func WithPingTimeout

func WithPingTimeout(d time.Duration) Option

func WithSessionShave

func WithSessionShave(d time.Duration) Option

func WithTransport

func WithTransport(name eiot.Name, tr func(SessionID, eiot.Codec) eiot.Transporter) Option

func WithTransportChannelBuffer

func WithTransportChannelBuffer(n int) Option

func WithTransportOption

func WithTransportOption(opts ...eiot.Option) Option

func WithUpgradeTimeout

func WithUpgradeTimeout(d time.Duration) Option

type OptionWith

type OptionWith = with.OptionWith

type Server

type Server = interface {
	OptionWith
	ServeHTTP(http.ResponseWriter, *http.Request)
}

func NewServer

func NewServer(opts ...Option) Server

func NewServerV2

func NewServerV2(opts ...Option) Server

func NewServerV3

func NewServerV3(opts ...Option) Server

func NewServerV4

func NewServerV4(opts ...Option) Server

func NewServerV5

func NewServerV5(opts ...Option) Server

type SessionID

type SessionID = eios.ID

type TransportName

type TransportName = eiot.Name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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