msg

package
v0.0.0-...-b45fbc0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineParserState

type LineParserState int
const (
	LineQuoteStart  LineParserState = 0
	LineQuoteAuthor LineParserState = 1
	LineQuoteLevel  LineParserState = 2
	LineQuoteBody   LineParserState = 3
)

type Message

type Message struct {
	ID          string
	MsgID       string
	Hash        string
	Area        string
	From        string
	To          string
	Subject     string
	Content     string
	UnixTime    int64
	DateWritten time.Time
	ViewCount   int
	Packet      []byte
	Reply       string
	FromAddr    string
}

func NewMessage

func NewMessage() *Message

func (Message) GetContent

func (self Message) GetContent() string

func (Message) GetFrom

func (self Message) GetFrom() string

func (Message) GetFromAddr

func (self Message) GetFromAddr() string

func (Message) GetMsgID

func (self Message) GetMsgID() string

func (Message) IsNew

func (self Message) IsNew() bool

func (*Message) SetArea

func (self *Message) SetArea(area string)

func (*Message) SetContent

func (self *Message) SetContent(content string)

func (*Message) SetFrom

func (self *Message) SetFrom(from string)

func (*Message) SetFromAddr

func (self *Message) SetFromAddr(addr string)

func (*Message) SetID

func (self *Message) SetID(id string)

func (*Message) SetMsgHash

func (self *Message) SetMsgHash(hash string)

func (*Message) SetMsgID

func (self *Message) SetMsgID(msgId string)

func (*Message) SetPacket

func (self *Message) SetPacket(packet []byte)

func (*Message) SetReply

func (self *Message) SetReply(reply string)

func (*Message) SetSubject

func (self *Message) SetSubject(subject string)

func (*Message) SetTime

func (self *Message) SetTime(ptm time.Time)

func (*Message) SetTo

func (self *Message) SetTo(to string)

func (*Message) SetUnixTime

func (self *Message) SetUnixTime(unixTime int64)

func (*Message) SetViewCount

func (self *Message) SetViewCount(count int)

type MessageAuthor

type MessageAuthor struct {
	FirstName string
	LastName  string
	QuoteName string
}

type MessageAuthorParser

type MessageAuthorParser struct {
}

func NewMessageAuthorParser

func NewMessageAuthorParser() *MessageAuthorParser

func (*MessageAuthorParser) Parse

func (self *MessageAuthorParser) Parse(author string) (*MessageAuthor, error)

type MessageDocument

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

func (*MessageDocument) Add

func (self *MessageDocument) Add(element MessageDocumentElement)

func (*MessageDocument) Content

func (self *MessageDocument) Content() string

func (*MessageDocument) HTML

func (self *MessageDocument) HTML() template.HTML

type MessageDocumentElement

type MessageDocumentElement interface {
}

type MessageDocumentQuote

type MessageDocumentQuote struct {
	MessageDocumentElement
	// contains filtered or unexported fields
}

type MessageDocumentRenderer

type MessageDocumentRenderer struct {
}

func NewMessageDocumentRenderer

func NewMessageDocumentRenderer() *MessageDocumentRenderer

func (*MessageDocumentRenderer) RenderAsHTML

func (self *MessageDocumentRenderer) RenderAsHTML(doc *MessageDocument) template.HTML

func (*MessageDocumentRenderer) RenderAsText

func (self *MessageDocumentRenderer) RenderAsText(doc *MessageDocument) string

type MessageDocumentText

type MessageDocumentText struct {
	MessageDocumentElement
	// contains filtered or unexported fields
}

type MessageLine

type MessageLine struct {
	PureLine     string
	QuoteAuthor  string
	QuoteStart   string
	QuoteMarkers string
	QuoteLine    string
	QuoteLevel   int
}

type MessageLineParser

type MessageLineParser struct {
	State LineParserState
}

func NewMessageLineParser

func NewMessageLineParser() *MessageLineParser

func (*MessageLineParser) Parse

func (self *MessageLineParser) Parse(oneLine string) *MessageLine

type MessageNode

type MessageNode struct {
	Items []*MessageNode
	// contains filtered or unexported fields
}

func NewMessageNode

func NewMessageNode(msg *Message) *MessageNode

func (*MessageNode) AddMessage

func (self *MessageNode) AddMessage(m Message)

func (*MessageNode) AddNode

func (self *MessageNode) AddNode(node *MessageNode)

func (MessageNode) GetValue

func (self MessageNode) GetValue() *Message

func (*MessageNode) SearchById

func (self *MessageNode) SearchById(msgid string) *MessageNode

type MessageReplyTransformer

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

func NewMessageReplyTransformer

func NewMessageReplyTransformer() *MessageReplyTransformer

func (*MessageReplyTransformer) SetAuthor

func (self *MessageReplyTransformer) SetAuthor(author string)

func (*MessageReplyTransformer) Transform

func (self *MessageReplyTransformer) Transform(content string) string

type MessageTextProcessor

type MessageTextProcessor struct {
}

func NewMessageTextProcessor

func NewMessageTextProcessor() *MessageTextProcessor

func (*MessageTextProcessor) ParseQuoteLine

func (self *MessageTextProcessor) ParseQuoteLine(quoteLine string) (author string, quoteLevel string, msg string)

func (*MessageTextProcessor) Prepare

func (self *MessageTextProcessor) Prepare(msg string) (*MessageDocument, error)

type MessageTree

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

func NewMessageTree

func NewMessageTree() *MessageTree

func (*MessageTree) Compact

func (self *MessageTree) Compact()

func (MessageTree) GetRoot

func (self MessageTree) GetRoot() *MessageNode

func (*MessageTree) RegisterMessage

func (self *MessageTree) RegisterMessage(m Message)

type SubjectCompactor

type SubjectCompactor struct {
}

func NewSubjectCompactor

func NewSubjectCompactor() *SubjectCompactor

func (SubjectCompactor) Compact

func (self SubjectCompactor) Compact(subject string) string

Jump to

Keyboard shortcuts

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