ws

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Issuer = "sola/ws"
)

Ctx

Variables

View Source
var (
	ErrOption = errors.New("Must set Handler")
	ErrNoUUID = errors.New("No UUID")
)

error(s)

View Source
var (
	ALL = [16]byte{}
)

meta

Functions

This section is empty.

Types

type ErrorHandler

type ErrorHandler func(uuid.UUID, error)

ErrorHandler of WebSocket

type Handler

type Handler func(uuid.UUID, []byte) error

Handler of WebSocket

func HandleWrap

func HandleWrap(build NewModel, h XHandle) Handler

HandleWrap Util

type NewModel

type NewModel func() interface{}

NewModel for XHandle

type Option

type Option struct {
	Handler Handler

	// Optional
	First        func(uuid.UUID)
	ReceiveError ErrorHandler
	SendError    ErrorHandler
	HandlerError ErrorHandler
}

Option of WebSocket

type Send

type Send func(uuid.UUID, []byte) error

Send Action

func New

func New(o *Option) (sola.Handler, Send)

New WebSocket Handler

type XHandle

type XHandle func(uuid.UUID, interface{}) error

XHandle with json

type XSend

type XSend func(uuid.UUID, interface{}) error

XSend with json

func SendWrap

func SendWrap(send Send) XSend

SendWrap Util

Jump to

Keyboard shortcuts

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