chat

package
v0.0.0-...-1e5eb42 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChatMessage is the message number of chat message.
	ChatMessage     uint64 = 1
	ChatMessageName        = "ChatMessage"
)

Variables

This section is empty.

Functions

func DeserializeMessage

func DeserializeMessage(data []byte) (message tao.Message, err error)

DeserializeMessage deserializes bytes into Message.

func ProcessMessage

func ProcessMessage(ctx context.Context, conn tao.WriteCloser)

ProcessMessage handles the Message logic.

Types

type Message

type Message struct {
	Content string
}

Message defines the chat message.

func (Message) RequestCommand

func (cm Message) RequestCommand() uint64

RequestCommand returns the request command.

func (Message) RequestName

func (cm Message) RequestName() string

RequestName returns the request name.

func (Message) ResponseCommand

func (cm Message) ResponseCommand() uint64

ResponseCommand returns the response command.

func (Message) ResponseName

func (cm Message) ResponseName() string

ResponseName returns the response name.

func (Message) Serialize

func (cm Message) Serialize() ([]byte, error)

Serialize Serializes Message into bytes.

func (Message) SetCustom

func (cm Message) SetCustom(interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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