data

package
v0.5.32 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: GPL-3.0 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 {
	Data string `json:"d"`

	channel.NeverEqual
	channel.NoClose
}

func BinaryMessage

func BinaryMessage(r channel.BinaryReader) (Message, error)

func BinaryMessageFromReader

func BinaryMessageFromReader(r io.Reader) Message

func JSONMessage

func JSONMessage(r io.Reader) (Message, io.Reader, error)

func (Message) Binary

func (m Message) Binary(w channel.BinaryWriter) error

func (Message) FromBinary

func (m Message) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (Message) FromJSON

func (m Message) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (Message) JSON

func (m Message) JSON(w io.Writer) error

type Notify

type Notify byte
const (
	NotifyDefault  Notify = 0
	NotifyPersonal Notify = 1 << iota
	NotifyNever
)

type ServerMessage

type ServerMessage struct {
	Message

	From   string    `json:"from"`
	Stamp  time.Time `json:"stamp"`
	PM     string    `json:"pm"`
	Notify Notify    `json:"notify"`
	Bot    bool      `json:"bot"`
	Shout  bool      `json:"shout"`

	channel.NeverEqual
	channel.NoClose
}

func BinaryServerMessage

func BinaryServerMessage(r channel.BinaryReader) (msg ServerMessage, err error)

func JSONServerMessage

func JSONServerMessage(r io.Reader) (ServerMessage, io.Reader, error)

func (ServerMessage) Binary

func (ServerMessage) FromBinary

func (m ServerMessage) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (ServerMessage) FromJSON

func (m ServerMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (ServerMessage) JSON

func (m ServerMessage) JSON(w io.Writer) error

Jump to

Keyboard shortcuts

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