comm

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Message  string
	UserName string
}

func (*Message) IsNil

func (u *Message) IsNil() bool

func (*Message) MarshalJSONObject

func (m *Message) MarshalJSONObject(enc *gojay.Encoder)

func (*Message) NKeys

func (m *Message) NKeys() int

func (*Message) UnmarshalJSONObject

func (m *Message) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

type Receiver

type Receiver chan *Message

func (Receiver) UnmarshalStream

func (s Receiver) UnmarshalStream(dec *gojay.StreamDecoder) error

type Sender

type Sender chan gojay.MarshalerJSONObject

Here are defined our communication types

func (Sender) MarshalStream

func (s Sender) MarshalStream(enc *gojay.StreamEncoder)

type SenderReceiver

type SenderReceiver struct {
	Send    Sender
	Receive Receiver
	Dec     *gojay.StreamDecoder
	Enc     *gojay.StreamEncoder
	Conn    *websocket.Conn
}

func (*SenderReceiver) Init

func (sc *SenderReceiver) Init(sender int) *SenderReceiver

func (*SenderReceiver) OnMessage

func (c *SenderReceiver) OnMessage(f func(*Message)) error

func (*SenderReceiver) SendMessage

func (sc *SenderReceiver) SendMessage(m gojay.MarshalerJSONObject) error

func (*SenderReceiver) SetReceiver

func (sc *SenderReceiver) SetReceiver()

func (*SenderReceiver) SetSender

func (sc *SenderReceiver) SetSender(nCons int)

Jump to

Keyboard shortcuts

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