Documentation
¶
Index ¶
- Variables
- type Attribute
- type AttributeIterator
- type Comment
- func (c *Comment) GetText() string
- func (c *Comment) InsertAfterAsHtml(content string) error
- func (c *Comment) InsertAfterAsRaw(content string) error
- func (c *Comment) InsertBeforeAsHtml(content string) error
- func (c *Comment) InsertBeforeAsRaw(content string) error
- func (c *Comment) IsRemoved() bool
- func (c *Comment) Remove()
- func (c *Comment) ReplaceAsHtml(content string) error
- func (c *Comment) ReplaceAsRaw(content string) error
- func (c *Comment) SetText(text string) error
- type CommentHandler
- type Config
- type DocEnd
- type DocEndHandler
- type Doctype
- type DoctypeHandler
- type Element
- func (e *Element) GetAttributeIterator() *AttributeIterator
- func (e *Element) GetAttributeValue(name string) (string, error)
- func (e *Element) GetNamespaceUri() string
- func (e *Element) GetTagName() string
- func (e *Element) HasAttribute(name string) (bool, error)
- func (e *Element) InsertAfterEndTagAsHtml(content string) error
- func (e *Element) InsertAfterEndTagAsRaw(content string) error
- func (e *Element) InsertAfterStartTagAsHtml(content string) error
- func (e *Element) InsertAfterStartTagAsRaw(content string) error
- func (e *Element) InsertBeforeEndTagAsHtml(content string) error
- func (e *Element) InsertBeforeEndTagAsRaw(content string) error
- func (e *Element) InsertBeforeStartTagAsHtml(content string) error
- func (e *Element) InsertBeforeStartTagAsRaw(content string) error
- func (e *Element) IsRemoved() bool
- func (e *Element) Remove()
- func (e *Element) RemoveAndKeepContent()
- func (e *Element) RemoveAttribute(name string) error
- func (e *Element) ReplaceAsHtml(content string) error
- func (e *Element) ReplaceAsRaw(content string) error
- func (e *Element) SetAttribute(name string, value string) error
- func (e *Element) SetInnerContentAsHtml(content string) error
- func (e *Element) SetInnerContentAsRaw(content string) error
- func (e *Element) SetTagName(name string) error
- type ElementHandler
- type MemorySettings
- type OutputSink
- type Rewriter
- type RewriterBuilder
- func (rb *RewriterBuilder) AddDocumentContentHandlers(doctypeHandler DoctypeHandler, commentHandler CommentHandler, ...)
- func (rb *RewriterBuilder) AddElementContentHandlers(selector *Selector, elementHandler ElementHandler, ...)
- func (rb *RewriterBuilder) Build(config Config) (*Rewriter, error)
- func (rb *RewriterBuilder) Free()
- type RewriterDirective
- type Selector
- type TextChunk
- func (t *TextChunk) GetContent() string
- func (t *TextChunk) InsertAfterAsHtml(content string) error
- func (t *TextChunk) InsertAfterAsRaw(content string) error
- func (t *TextChunk) InsertBeforeAsHtml(content string) error
- func (t *TextChunk) InsertBeforeAsRaw(content string) error
- func (t *TextChunk) IsLastInTextNode() bool
- func (t *TextChunk) IsRemoved() bool
- func (t *TextChunk) Remove()
- func (t *TextChunk) ReplaceAsHtml(content string) error
- func (t *TextChunk) ReplaceAsRaw(content string) error
- type TextChunkContent
- type TextChunkHandler
Constants ¶
This section is empty.
Variables ¶
var ErrCannotGetErrorMessage = errors.New("cannot get error message from underlying lol-html lib")
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute C.lol_html_attribute_t
Attribute as declared in include/lol_html.h:30
type AttributeIterator ¶
type AttributeIterator C.lol_html_attributes_iterator_t
AttributeIterator as declared in include/lol_html.h:29
func (*AttributeIterator) Free ¶
func (ai *AttributeIterator) Free()
func (*AttributeIterator) Next ¶
func (ai *AttributeIterator) Next() *Attribute
type Comment ¶
type Comment C.lol_html_comment_t
Comment as declared in include/lol_html.h:26
func (*Comment) InsertAfterAsHtml ¶
func (*Comment) InsertAfterAsRaw ¶
func (*Comment) InsertBeforeAsHtml ¶
func (*Comment) InsertBeforeAsRaw ¶
func (*Comment) ReplaceAsHtml ¶
func (*Comment) ReplaceAsRaw ¶
type CommentHandler ¶
type CommentHandler func(*Comment) RewriterDirective
CommentHandler type as declared in include/lol_html.h:91
type Config ¶
type Config struct { Encoding string Memory *MemorySettings Sink OutputSink //UserData interface{} Strict bool }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type DocEnd ¶
type DocEnd C.lol_html_doc_end_t
DocEnd as declared in include/lol_html.h:25
func (*DocEnd) AppendAsHtml ¶
func (*DocEnd) AppendAsRaw ¶
type DocEndHandler ¶
type DocEndHandler func(*DocEnd) RewriterDirective
DocEndHandler type as declared in include/lol_html.h:106
type Doctype ¶
type Doctype C.lol_html_doctype_t
Doctype as declared in include/lol_html.h:24
func (*Doctype) GetPublicId ¶
func (*Doctype) GetSystemId ¶
type DoctypeHandler ¶
type DoctypeHandler func(*Doctype) RewriterDirective
DoctypeHandler type as declared in include/lol_html.h:86
type Element ¶
type Element C.lol_html_element_t
Element as declared in include/lol_html.h:28
func (*Element) GetAttributeIterator ¶
func (e *Element) GetAttributeIterator() *AttributeIterator
func (*Element) GetAttributeValue ¶
func (*Element) GetNamespaceUri ¶
func (*Element) GetTagName ¶
func (*Element) InsertAfterEndTagAsHtml ¶
func (*Element) InsertAfterEndTagAsRaw ¶
func (*Element) InsertAfterStartTagAsHtml ¶
func (*Element) InsertAfterStartTagAsRaw ¶
func (*Element) InsertBeforeEndTagAsHtml ¶
func (*Element) InsertBeforeEndTagAsRaw ¶
func (*Element) InsertBeforeStartTagAsHtml ¶
func (*Element) InsertBeforeStartTagAsRaw ¶
func (*Element) RemoveAndKeepContent ¶
func (e *Element) RemoveAndKeepContent()
func (*Element) RemoveAttribute ¶
func (*Element) ReplaceAsHtml ¶
func (*Element) ReplaceAsRaw ¶
func (*Element) SetInnerContentAsHtml ¶
func (*Element) SetInnerContentAsRaw ¶
func (*Element) SetTagName ¶
type ElementHandler ¶
type ElementHandler func(*Element) RewriterDirective
ElementHandler type as declared in include/lol_html.h:101
type MemorySettings ¶
type OutputSink ¶
type OutputSink func(string)
type Rewriter ¶
type Rewriter C.lol_html_rewriter_t
Rewriter as declared in include/lol_html.h:23
func (*Rewriter) WriteString ¶
type RewriterBuilder ¶
type RewriterBuilder C.lol_html_rewriter_builder_t
RewriterBuilder as declared in include/lol_html.h:22
func NewRewriterBuilder ¶
func NewRewriterBuilder() *RewriterBuilder
func (*RewriterBuilder) AddDocumentContentHandlers ¶
func (rb *RewriterBuilder) AddDocumentContentHandlers( doctypeHandler DoctypeHandler, commentHandler CommentHandler, textChunkHandler TextChunkHandler, docEndHandler DocEndHandler, )
TODO: BUG? For now, to use *Rewriter.End() without causing panic, you will probably need to assign a stub handler function to it.
func (*RewriterBuilder) AddElementContentHandlers ¶
func (rb *RewriterBuilder) AddElementContentHandlers( selector *Selector, elementHandler ElementHandler, commentHandler CommentHandler, textChunkHandler TextChunkHandler, )
func (*RewriterBuilder) Free ¶
func (rb *RewriterBuilder) Free()
type RewriterDirective ¶
type RewriterDirective int
RewriterDirective as declared in include/lol_html.h:84
const ( Continue RewriterDirective = iota Stop )
RewriterDirective enumeration from include/lol_html.h:84
type Selector ¶
type Selector C.lol_html_selector_t
Selector as declared in include/lol_html.h:31
func NewSelector ¶
type TextChunk ¶
type TextChunk C.lol_html_text_chunk_t
TextChunk as declared in include/lol_html.h:27
func (*TextChunk) GetContent ¶
func (*TextChunk) InsertAfterAsHtml ¶
func (*TextChunk) InsertAfterAsRaw ¶
func (*TextChunk) InsertBeforeAsHtml ¶
func (*TextChunk) InsertBeforeAsRaw ¶
func (*TextChunk) IsLastInTextNode ¶
func (*TextChunk) ReplaceAsHtml ¶
func (*TextChunk) ReplaceAsRaw ¶
type TextChunkContent ¶
type TextChunkContent C.lol_html_text_chunk_content_t
TextChunkContent as declared in include/lol_html.h:60
type TextChunkHandler ¶
type TextChunkHandler func(*TextChunk) RewriterDirective
TextChunkHandler type as declared in include/lol_html.h:96