Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TagParser ¶
type TagParser struct {
// contains filtered or unexported fields
}
TagParser Non-concurrency safe, a TagParser can only be used for one stream
func NewTagParser ¶
func (*TagParser) Parse ¶
func (p *TagParser) Parse(streamStr string) (tagsData []*TagStreamData)
func (*TagParser) ParseDone ¶
func (p *TagParser) ParseDone() (tagsData []*TagStreamData)
type TagStreamData ¶
type TagStreamData struct { Type TagStreamType `json:"type"` Text string `json:"text,omitempty"` // text is the content outside the tag TagName string `json:"tag_name,omitempty"` Attrs []TagAttr `json:"attrs,omitempty"` Content string `json:"content,omitempty"` // content is the content of the tag }
func NewContentTagStreamData ¶
func NewContentTagStreamData(tagName, content string) *TagStreamData
func NewEndTagStreamData ¶
func NewEndTagStreamData(tagName string, attrs []TagAttr, content string) *TagStreamData
func NewStartTagStreamData ¶
func NewStartTagStreamData(tagName string, attrs []TagAttr) *TagStreamData
func NewTextTagStreamData ¶
func NewTextTagStreamData(text string) *TagStreamData
type TagStreamType ¶
type TagStreamType string
const ( TagStreamTypeText TagStreamType = "text" TagStreamTypeStart TagStreamType = "start" TagStreamTypeContent TagStreamType = "content" TagStreamTypeEnd TagStreamType = "end" )
Click to show internal directories.
Click to hide internal directories.