You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2026-06-19 23:24:30 +02:00
98feb29e57
* Use XML parser based on encoding/xml * Implement raw XML parser * Speed-up xml parser * Add line number to XML parser syntax errors * Add svgparser.StartElement.SelfClosing * Utilize bufio.Reader.ReadSlice in XML parser * Polish XML parser tests; Add XML parser benchmark * Move XML parser to ./xmlparser * Use all XML parser tokens as pointers * Add xmlparser.Document.ReplaceEntities method * Combine xmlparser.Text and xmlparset.CData * Optimize entities replacement in xmlparser * xmlparser.parseEntityMap: ignore comments * xmlparser: add document parsing benchmark * xmlparser: Refactor attributes * xmlparser: simplify Attributes.Filter * xmlparser: add Attributes.Has, Node.FilterChildren, and Node.FilterChildNodes * xmlparser: add Node.ChildNodes
15 lines
218 B
Go
15 lines
218 B
Go
package xmlparser
|
|
|
|
import "io"
|
|
|
|
type writeCounter struct {
|
|
Writer io.Writer
|
|
Count int64
|
|
}
|
|
|
|
func (wc *writeCounter) Write(p []byte) (int, error) {
|
|
n, err := wc.Writer.Write(p)
|
|
wc.Count += int64(n)
|
|
return n, err
|
|
}
|