package parser
import "go.mongodb.org/mongo-driver/bson/parser"
Index ¶
- Variables
- type Parser
- func NewBSONParser(r io.Reader) (*Parser, error)
- func (p *Parser) ParseBinary() (*ast.Binary, error)
- func (p *Parser) ParseCString() (string, error)
- func (p *Parser) ParseCodeWithScope() (*ast.CodeWithScope, error)
- func (p *Parser) ParseDocument() (*ast.Document, error)
- func (p *Parser) ParseDouble() (float64, error)
- func (p *Parser) ParseEList() ([]ast.Element, error)
- func (p *Parser) ParseEName() (*ast.ElementKeyName, error)
- func (p *Parser) ParseElement() (ast.Element, error)
- func (p *Parser) ParseString() (string, error)
- func (p *Parser) ParseSubtype() (ast.BinarySubtype, error)
Variables ¶
ErrCorruptDocument is returned when the parser reaches a corrupt point within a BSON document.
ErrNilReader is returned when a nil reader is passed to NewBSONParser.
ErrUnknownSubtype is returned when the subtype of a binary node is undefined.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a BSON parser.
func NewBSONParser ¶
NewBSONParser instantiates a new BSON Parser with the given reader.
func (*Parser) ParseBinary ¶
ParseBinary parses a binary node from the parser's reader.
func (*Parser) ParseCString ¶
ParseCString parses a c-style string from the parser's reader.
TODO(skriptble): Should this be a read* method since it's returning a Go primitive? That would fit with the rest of the read* methods.
func (*Parser) ParseCodeWithScope ¶
func (p *Parser) ParseCodeWithScope() (*ast.CodeWithScope, error)
ParseCodeWithScope parses a JavaScript Code with Scope node from the parser's reader.
func (*Parser) ParseDocument ¶
ParseDocument parses an entire document from the parser's reader.
func (*Parser) ParseDouble ¶
ParseDouble parses a float64 from the parser's reader.
TODO(skriptble): This should be a read* method.
func (*Parser) ParseEList ¶
ParseEList parses an entire element list from the parser's reader.
func (*Parser) ParseEName ¶
func (p *Parser) ParseEName() (*ast.ElementKeyName, error)
ParseEName parses an element's key from the parser's reader.
func (*Parser) ParseElement ¶
ParseElement parses an element from the parser's reader.
func (*Parser) ParseString ¶
ParseString parses a string from the parser's reader.
TODO(skriptble): Should this be a read* method since it's returning a Go primitive? That would fit with the rest of the read* methods.
func (*Parser) ParseSubtype ¶
func (p *Parser) ParseSubtype() (ast.BinarySubtype, error)
ParseSubtype parses the subtype for a binary node from the parser's reader.
Source Files ¶
parser.go
Directories ¶
Path | Synopsis |
---|---|
bson/parser/ast |
- Version
- v0.0.9
- Published
- Jul 10, 2018
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 3 minutes ago –
Tools for package owners.