message

package
v6.4.11 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(key []byte, m Message) (b []byte, err error)

Encode will convert to bytes

func Send

func Send(c *comm.Comm, key []byte, m Message) (err error)

Send will send out

Types

type Message

type Message struct {
	Type    string `json:"t,omitempty"`
	Message string `json:"m,omitempty"`
	Bytes   []byte `json:"b,omitempty"`
	Num     int    `json:"n,omitempty"`
}

Message is the possible payload for messaging

func Decode

func Decode(key []byte, b []byte) (m Message, err error)

Decode will convert from bytes

func (Message) String

func (m Message) String() string

Jump to

Keyboard shortcuts

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