middleware

package
v0.0.0-...-add256a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUpgrader = Upgrader(gorilla.Upgrader{

	CheckOrigin: func(r *http.Request) bool {
		return true
	},
})

DefaultUpgrader is a gorilla/websocket Upgrader with all fields set to the default values.

Functions

func CrsAuth

func CrsAuth(app string) context.Handler

CrsAuth 跨域中间件

func DBResolver

func DBResolver() iris.Handler

func Error

func Error() iris.Handler

func Upgrader

func Upgrader(upgrader gorilla.Upgrader) neffos.Upgrader

Upgrader is a `neffos.Upgrader` type for the gorilla/websocket subprotocol implementation. Should be used on `New` to construct the neffos server.

func UserAuth

func UserAuth() iris.Handler

Types

type Socket

type Socket struct {
	UnderlyingConn *gorilla.Conn
	// contains filtered or unexported fields
}

Socket completes the `neffos.Socket` interface, it describes the underline websocket connection.

func (*Socket) NetConn

func (s *Socket) NetConn() net.Conn

NetConn returns the underline net connection.

func (*Socket) ReadData

func (s *Socket) ReadData(timeout time.Duration) ([]byte, neffos.MessageType, error)

ReadData reads binary or text messages from the remote connection.

func (*Socket) Request

func (s *Socket) Request() *http.Request

Request returns the http request value.

func (*Socket) WriteBinary

func (s *Socket) WriteBinary(body []byte, timeout time.Duration) error

WriteBinary sends a binary message to the remote connection.

func (*Socket) WriteText

func (s *Socket) WriteText(body []byte, timeout time.Duration) error

WriteText sends a text message to the remote connection.

Jump to

Keyboard shortcuts

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