Documentation ¶
Index ¶
- type LineParserState
- type Message
- func (self Message) GetContent() string
- func (self Message) GetFrom() string
- func (self Message) GetFromAddr() string
- func (self Message) GetMsgID() string
- func (self Message) IsNew() bool
- func (self *Message) SetArea(area string)
- func (self *Message) SetContent(content string)
- func (self *Message) SetFrom(from string)
- func (self *Message) SetFromAddr(addr string)
- func (self *Message) SetID(id string)
- func (self *Message) SetMsgHash(hash string)
- func (self *Message) SetMsgID(msgId string)
- func (self *Message) SetPacket(packet []byte)
- func (self *Message) SetReply(reply string)
- func (self *Message) SetSubject(subject string)
- func (self *Message) SetTime(ptm time.Time)
- func (self *Message) SetTo(to string)
- func (self *Message) SetUnixTime(unixTime int64)
- func (self *Message) SetViewCount(count int)
- type MessageAuthor
- type MessageAuthorParser
- type MessageDocument
- type MessageDocumentElement
- type MessageDocumentQuote
- type MessageDocumentRenderer
- type MessageDocumentText
- type MessageLine
- type MessageLineParser
- type MessageNode
- type MessageReplyTransformer
- type MessageTextProcessor
- type MessageTree
- type SubjectCompactor
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 (Message) GetFromAddr ¶
func (*Message) SetContent ¶
func (*Message) SetFromAddr ¶
func (*Message) SetMsgHash ¶
func (*Message) SetSubject ¶
func (*Message) SetUnixTime ¶
func (*Message) SetViewCount ¶
type MessageAuthor ¶
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 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
Click to show internal directories.
Click to hide internal directories.