utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMessageFromByte

func CreateMessageFromByte(message []byte) evtwebsocket.Msg

func CreateMessageFromString

func CreateMessageFromString(message string) evtwebsocket.Msg

func DeserializeData

func DeserializeData(data []byte) (jsonObject interface{})

func DeserializeDataFromString

func DeserializeDataFromString(data string) (jsonObject interface{})

func GetAuthToken

func GetAuthToken(message interface{}) string

func GetIsAuthenticated

func GetIsAuthenticated(message interface{}) bool

func IsEqual

func IsEqual(s string, b []byte) bool

func PrintMessage

func PrintMessage(message string)

func SerializeData

func SerializeData(data interface{}) []byte

func SerializeDataIntoString

func SerializeDataIntoString(data interface{}) string

func SetMarshaller

func SetMarshaller(isCodecMinBin bool)

Types

type AtomicCounter

type AtomicCounter struct {
	Counter uint64
}

func (*AtomicCounter) GetAndIncrement

func (atomicCounter *AtomicCounter) GetAndIncrement() uint64

func (*AtomicCounter) IncrementAndGet

func (atomicCounter *AtomicCounter) IncrementAndGet() uint64

func (*AtomicCounter) Reset

func (atomicCounter *AtomicCounter) Reset()

func (*AtomicCounter) Value

func (atomicCounter *AtomicCounter) Value() uint64

type Jsoner

type Jsoner struct{}

func (Jsoner) Marshal

func (m Jsoner) Marshal(v interface{}) ([]byte, error)

func (Jsoner) Unmarshal

func (m Jsoner) Unmarshal(data []byte, v interface{}) error

type Marshaller

type Marshaller interface {
	Marshal(interface{}) ([]byte, error)
}

type ModifiedMsgE

type ModifiedMsgE struct {
	E []interface{} `json:"e" msgpack:"e"`
}

type ModifiedMsgP

type ModifiedMsgP struct {
	P []interface{} `json:"p" msgpack:"p"`
}

type ModifiedMsgR

type ModifiedMsgR struct {
	R []interface{} `json:"r" msgpack:"r"`
}

type Msgpacker

type Msgpacker struct{}

func (Msgpacker) Marshal

func (m Msgpacker) Marshal(i interface{}) (result []byte, err error)

func (Msgpacker) Unmarshal

func (m Msgpacker) Unmarshal(data []byte, i interface{}) error

type Unmarshaller

type Unmarshaller interface {
	Unmarshal(data []byte, v interface{}) error
}

Jump to

Keyboard shortcuts

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