nws

package module
v0.0.0-...-55db9ca Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 7 Imported by: 0

README

easy json

goos: darwin
goarch: amd64
pkg: github.com/kl7sn/toolkit/nws
cpu: VirtualApple @ 2.50GHz
BenchmarkDecodeNodeSocketIO
BenchmarkDecodeNodeSocketIO-8   	  437698	      2590 ns/op

encoding/json

goos: darwin
goarch: amd64
pkg: github.com/kl7sn/toolkit/nws
cpu: VirtualApple @ 2.50GHz
BenchmarkDecodeNodeSocketIO
BenchmarkDecodeNodeSocketIO-8   	  325502	      3540 ns/op

Documentation

Index

Constants

View Source
const (
	FcOpen    = 0
	FcClose   = 1
	FcPing    = 2
	FcPong    = 3
	FcMessage = 4
	FcUpgrade = 5
	FcNoop    = 6
)
View Source
const (
	ScEmpty       = -1
	ScConnect     = 0
	ScDisconnect  = 1
	ScEvent       = 2
	ScAck         = 3
	ScError       = 4
	ScBinaryEvent = 5
	ScBinaryAck   = 6
)
View Source
const (
	EventMessage = "message"
)

Variables

This section is empty.

Functions

func DecodeNodeSocketIO

func DecodeNodeSocketIO(in []byte, r *regexp.Regexp) (content string, typ string, err error)

func EncodeNodeSocketIO

func EncodeNodeSocketIO(typ string, fc, sc int, b []byte) []byte

Types

type CompatMsg

type CompatMsg struct {
	Event string      `json:"event,omitempty"`
	Data  interface{} `json:"data,omitempty"`
}

func (CompatMsg) JSON

func (c CompatMsg) JSON() []byte

func (CompatMsg) MarshalEasyJSON

func (v CompatMsg) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CompatMsg) MarshalJSON

func (v CompatMsg) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CompatMsg) UnmarshalEasyJSON

func (v *CompatMsg) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CompatMsg) UnmarshalJSON

func (v *CompatMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CompatMsgDataItem

type CompatMsgDataItem struct {
	Type string      `json:"type,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

func (CompatMsgDataItem) JSON

func (c CompatMsgDataItem) JSON() []byte

func (CompatMsgDataItem) MarshalEasyJSON

func (v CompatMsgDataItem) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CompatMsgDataItem) MarshalJSON

func (v CompatMsgDataItem) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CompatMsgDataItem) UnmarshalEasyJSON

func (v *CompatMsgDataItem) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CompatMsgDataItem) UnmarshalJSON

func (v *CompatMsgDataItem) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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