ast

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayElement

type ArrayElement struct {
	Name  *ElementKeyName
	Array *Document
}

ArrayElement represents a BSON array element.

type Binary

type Binary struct {
	Subtype BinarySubtype
	Data    []byte
}

Binary represents a BSON binary node.

func (*Binary) GoString

func (b *Binary) GoString() string

GoString implements the fmt.GoStringer interface.

func (*Binary) String

func (b *Binary) String() string

String implements the fmt.Stringer interface.

type BinaryElement

type BinaryElement struct {
	Name   *ElementKeyName
	Binary *Binary
}

BinaryElement represents a BSON binary element.

type BinarySubtype

type BinarySubtype byte

BinarySubtype describes the subtype of a Binary node.

const (
	SubtypeGeneric     BinarySubtype = '\x00' // Generic, default
	SubtypeFunction    BinarySubtype = '\x01' // Function
	SubtypeBinaryOld   BinarySubtype = '\x02' // Old Binary, prefixed with length
	SubtypeUUIDOld     BinarySubtype = '\x03' // Old UUID
	SubtypeUUID        BinarySubtype = '\x04' // UUID
	SubtypeMD5         BinarySubtype = '\x05' // MD5
	SubtypeUserDefined BinarySubtype = '\x80' // User defined types, anything greater than this
)

The possible Binary Subtypes.

type BoolElement

type BoolElement struct {
	Name *ElementKeyName
	Bool bool
}

BoolElement represents a BSON boolean element.

type CString

type CString struct {
	String string
}

CString represents a BSON cstring.

type CodeWithScope

type CodeWithScope struct {
	String   string
	Document *Document
}

CodeWithScope represents a BSON JavaScript with scope node.

type CodeWithScopeElement

type CodeWithScopeElement struct {
	Name          *ElementKeyName
	CodeWithScope *CodeWithScope
}

CodeWithScopeElement represents a BSON JavaScript with scope element.

type DBPointerElement

type DBPointerElement struct {
	Name    *ElementKeyName
	String  string
	Pointer objectid.ObjectID
}

DBPointerElement represents a BSON db pointer element.

type DateTimeElement

type DateTimeElement struct {
	Name *ElementKeyName
	// TODO(skriptble): This should be an actual time.Time value
	DateTime int64
}

DateTimeElement represents a BSON datetime element.

type DecimalElement

type DecimalElement struct {
	Name       *ElementKeyName
	Decimal128 decimal.Decimal128
}

DecimalElement represents a BSON Decimal128 element.

TODO(skriptble): Borrowing the Decimal128 implementation from mgo/bson for now until we write a new implementation, preferably using the math/big package and providing a way to return a big.Float.

type Document

type Document struct {
	Length int32
	EList  []Element
}

Document represents a BSON Document.

type DocumentElement

type DocumentElement struct {
	Name     *ElementKeyName
	Document *Document
}

DocumentElement represents a BSON subdocument element.

type Element

type Element interface {
	// contains filtered or unexported methods
}

Element represents an individual element of a BSON document. All element types implement the Element interface.

type ElementKeyName

type ElementKeyName struct {
	Key string
}

ElementKeyName represents the key for a BSON Document element.

func (*ElementKeyName) GoString

func (ekn *ElementKeyName) GoString() string

GoString implements the fmt.GoStringer interface.

func (*ElementKeyName) String

func (ekn *ElementKeyName) String() string

String implements the fmt.Stringer interface.

type FloatElement

type FloatElement struct {
	Name   *ElementKeyName
	Double float64
}

FloatElement represents a BSON double element.

type Int32Element

type Int32Element struct {
	Name  *ElementKeyName
	Int32 int32
}

Int32Element represents a BSON int32 element.

type Int64Element

type Int64Element struct {
	Name  *ElementKeyName
	Int64 int64
}

Int64Element represents a BSON int64 element.

type JavaScriptElement

type JavaScriptElement struct {
	Name   *ElementKeyName
	String string
}

JavaScriptElement represents a BSON JavaScript element.

type MaxKeyElement

type MaxKeyElement struct {
	Name *ElementKeyName
}

MaxKeyElement represents a BSON max key element.

type MinKeyElement

type MinKeyElement struct {
	Name *ElementKeyName
}

MinKeyElement represents a BSON min key element.

type NullElement

type NullElement struct {
	Name *ElementKeyName
}

NullElement represents a BSON null element.

type ObjectIDElement

type ObjectIDElement struct {
	Name *ElementKeyName
	ID   objectid.ObjectID
}

ObjectIDElement represents a BSON objectID element.

type RegexElement

type RegexElement struct {
	Name         *ElementKeyName
	RegexPattern *CString
	RegexOptions *CString
}

RegexElement represents a BSON regex element.

type StringElement

type StringElement struct {
	Name   *ElementKeyName
	String string
}

StringElement represents a BSON string element.

type SymbolElement

type SymbolElement struct {
	Name   *ElementKeyName
	String string
}

SymbolElement represents a BSON symbol element.

type TimestampElement

type TimestampElement struct {
	Name      *ElementKeyName
	Timestamp uint64
}

TimestampElement represents a BSON timestamp element.

type UndefinedElement

type UndefinedElement struct {
	Name *ElementKeyName
}

UndefinedElement represents a BSON undefined element.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL