message

package
v0.0.0-...-54812e6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE  = "message"
	COMMAND  = "command"
	RESPONSE = "response"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Raw    string
	Cmd    string
	Params string
}

func (*Command) GetType

func (c *Command) GetType() string

func (*Command) Parse

func (c *Command) Parse() ([]byte, error)

Parse parses the command and returns the command name and parameters. /cmd params

type Message

type Message struct {
	Msg string
}

func (*Message) GetType

func (m *Message) GetType() string

func (*Message) Parse

func (m *Message) Parse() ([]byte, error)

type Response

type Response struct {
	Msg string
}

func (*Response) GetType

func (r *Response) GetType() string

func (*Response) Parse

func (r *Response) Parse() ([]byte, error)

type SendAble

type SendAble interface {
	Parse() ([]byte, error)
	GetType() string
}

func NewSendAble

func NewSendAble(msg string) SendAble

Jump to

Keyboard shortcuts

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