comm

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 4 Imported by: 15 modules, 39 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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