qqmsg

package
v0.0.0-...-a78a1a0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgText         = 1
	MsgFace         = 2
	MsgGroupImage   = 3
	MsgPrivateImage = 6
	MsgVoice        = 7
	MsgNickName     = 18
	MsgVideo        = 26
)

Variables

Functions

func DecodeNickname

func DecodeNickname(b []byte) string

func DecodeUtf16

func DecodeUtf16(b []byte) string

func EncodeMsg

func EncodeMsg(msg Msg) string

Types

type Buffer

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

func NewBuffer

func NewBuffer(buf []byte) *Buffer

func (*Buffer) Byte

func (b *Buffer) Byte() (by byte)

func (*Buffer) L

func (b *Buffer) L() uint16

func (*Buffer) Read

func (b *Buffer) Read(n int) []byte

func (*Buffer) Skip

func (b *Buffer) Skip(n int)

func (*Buffer) T

func (b *Buffer) T() uint8

func (*Buffer) TLV

func (b *Buffer) TLV() (t uint8, l uint16, v []byte)

func (*Buffer) Uint16

func (b *Buffer) Uint16() (u uint16)

func (*Buffer) Uint32

func (b *Buffer) Uint32() (u uint32)

type ElementType

type ElementType int

type FaceElement

type FaceElement struct {
	Id   int
	Name string
}

func (*FaceElement) Type

func (e *FaceElement) Type() ElementType
type Header struct {
	Time       uint32
	Rand       uint32
	Color      uint32
	FontSize   uint8
	FontSylte  uint8
	Charset    uint8
	FontFamily uint8
	FontName   string
}

type ImageElement

type ImageElement struct {
	Path string
	Hash []byte
}

func (*ImageElement) Type

func (e *ImageElement) Type() ElementType

type Int

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

type Msg

type Msg struct {
	Header         Header
	Elements       []MsgElem
	SenderNickname string
}

func Unpack

func Unpack(b []byte) Msg

type MsgElem

type MsgElem interface {
	Type() ElementType
}

func DecodeFace

func DecodeFace(b []byte) MsgElem

func DecodeImage

func DecodeImage(b []byte) MsgElem

func DecodeTextMsg

func DecodeTextMsg(b []byte) MsgElem

func DecodeVideo

func DecodeVideo(b []byte) MsgElem

func DecodeVoice

func DecodeVoice(b []byte) MsgElem

type TextElement

type TextElement struct {
	Content string
}

func (*TextElement) Type

func (e *TextElement) Type() ElementType

type VideoElement

type VideoElement struct {
	Hash []byte
}

func (*VideoElement) Type

func (e *VideoElement) Type() ElementType

type VoiceElement

type VoiceElement struct {
	Hash []byte
}

func (*VoiceElement) Type

func (e *VoiceElement) Type() ElementType

Jump to

Keyboard shortcuts

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