Documentation
¶
Overview ¶
Package parse contains a collection of parsers for various formats in its subpackages.
Index ¶
- Variables
- func Copy(src []byte) (dst []byte)
- func DataURI(dataURI []byte) ([]byte, []byte, error)
- func Dimension(b []byte) (int, int)
- func Equal(s, target []byte) bool
- func EqualFold(s, targetLower []byte) bool
- func Int(b []byte) (int64, bool)
- func IsAllWhitespace(b []byte) bool
- func IsWhitespace(c byte) bool
- func Number(b []byte) int
- func QuoteEntity(b []byte) (quote byte, n int)
- func ReplaceMultiple(b []byte, f func(byte) bool, r byte) []byte
- func ToLower(src []byte) []byte
- func Trim(b []byte, f func(byte) bool) []byte
Constants ¶
This section is empty.
Variables ¶
var ErrBadDataURI = errors.New("not a data URI")
Returned by DataURI when the byte slice does not start with 'data:' or is too short.
Functions ¶
func EqualFold ¶
EqualFold returns true when s matches case-insensitively the targetLower (which must be lowercase).
func IsAllWhitespace ¶
IsAllWhitespace returns true when the entire byte slice consists of space, \n, \t, \f, \r.
func IsWhitespace ¶
IsWhitespace returns true for space, \n, \t, \f, \r.
func Number ¶
Number returns the number of bytes that parse as a number of the regex format (+|-)?([0-9]+(\.[0-9]+)?|\.[0-9]+)((e|E)(+|-)?[0-9]+)?.
func QuoteEntity ¶
QuoteEntity parses the given byte slice and returns the quote that got matched (' or "), its entity length and ok.
func ReplaceMultiple ¶
ReplaceMultiple replaces any character serie for which the function return true into a single character given by r.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package css is a CSS3 lexer and parser following the specifications at http://www.w3.org/TR/css-syntax-3/.
|
Package css is a CSS3 lexer and parser following the specifications at http://www.w3.org/TR/css-syntax-3/. |
Package html is an HTML5 lexer following the specifications at http://www.w3.org/TR/html5/syntax.html.
|
Package html is an HTML5 lexer following the specifications at http://www.w3.org/TR/html5/syntax.html. |
Package js is an ECMAScript5.1 lexer following the specifications at http://www.ecma-international.org/ecma-262/5.1/.
|
Package js is an ECMAScript5.1 lexer following the specifications at http://www.ecma-international.org/ecma-262/5.1/. |
Package jsom is a JSON parser following the specifications at http://json.org/.
|
Package jsom is a JSON parser following the specifications at http://json.org/. |
Package xml is an XML1.0 lexer following the specifications at http://www.w3.org/TR/xml/.
|
Package xml is an XML1.0 lexer following the specifications at http://www.w3.org/TR/xml/. |