msgdata

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownMessageType  = &SHandlerError{"unknown message type"}
	ErrUnwrapFile          = &SHandlerError{"unwrap file"}
	ErrHasNotWritableChars = &SHandlerError{"had not writable chars"}
	ErrMessageNull         = &SHandlerError{"message null"}
	ErrReadFile            = &SHandlerError{"read file"}
	ErrReadFileSize        = &SHandlerError{"read file size"}
	ErrGetFormFile         = &SHandlerError{"get form file"}
	ErrUploadFile          = &SHandlerError{"upload file"}
)

Functions

func FilenameEscape

func FilenameEscape(pFilename string) string

func GetMessageBytes

func GetMessageBytes(pR *http.Request) ([]byte, error)

func ReplaceTextToEmoji

func ReplaceTextToEmoji(pS string) string

func ReplaceTextToURLs

func ReplaceTextToURLs(pS string) string

Types

type IMessageBroker

type IMessageBroker interface {
	Produce(string, SMessage)
	Consume(string) (SMessage, bool)
}

func NewMessageBroker

func NewMessageBroker() IMessageBroker

type SHandlerError

type SHandlerError struct {
	// contains filtered or unexported fields
}

func (*SHandlerError) Error

func (err *SHandlerError) Error() string

type SMessage

type SMessage struct {
	FTimestamp string        `json:"timestamp"`
	FTextData  template.HTML `json:"textdata"`
	FFileName  template.HTML `json:"filename"`
	FFileData  string        `json:"filedata"`
}

func GetMessage

func GetMessage(rawMsgBytes []byte, timestamp string) (SMessage, error)

type SSubscribe

type SSubscribe struct {
	FAddress string `json:"address"`
}

Jump to

Keyboard shortcuts

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