message

package
v0.0.0-...-43db901 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 2 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 {
	Content   *json.RawMessage `json:"content"`
	Timestamp int64            `json:"timestamp"`
}

Message is a type that stores timestamp and content and can return the json serialized version

func New

func New(jsonMessage []byte) *Message

New creates a new Message type with fields for timestamp and a json message

func NewBlankMessage

func NewBlankMessage() *Message

func (Message) Serialize

func (m Message) Serialize() []byte

Serialize returns a serialized JSON string that includes the current timestamp

Jump to

Keyboard shortcuts

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