Documentation ¶
Overview ¶
Package types contains most of the data structures available to/from Noms.
Index ¶
- Constants
- Variables
- func ApplyEdits(ctx context.Context, edits EditProvider, m Map) (Map, AppliedEditStats, error)
- func ApplyNEdits(ctx context.Context, edits EditProvider, m Map, numEdits int64) (Map, AppliedEditStats, error)
- func ContainCommonSupertype(nbf *NomsBinFormat, a, b *Type) bool
- func EncodeValue(v Value, nbf *NomsBinFormat) (chunks.Chunk, error)
- func EncodedIndexValue(ctx context.Context, v Value) (string, error)
- func EncodedValue(ctx context.Context, v Value) (string, error)
- func EncodedValueMaxLines(ctx context.Context, v Value, maxLines uint32) (string, error)
- func EscapeStructField(input string) string
- func HasStructCycles(t *Type) bool
- func IsFormat_DOLT_1(nbf *NomsBinFormat) bool
- func IsGeometryKind(k NomsKind) bool
- func IsMapLeaf(m Map) bool
- func IsNull(val Value) bool
- func IsPrimitiveKind(k NomsKind) bool
- func IsSubtype(nbf *NomsBinFormat, requiredType, concreteType *Type) bool
- func IsSubtypeDisallowExtraStructFields(nbf *NomsBinFormat, requiredType, concreteType *Type) bool
- func IsValidStructFieldName(name string) bool
- func IsValueSubtypeOf(nbf *NomsBinFormat, v Value, t *Type) (bool, error)
- func IsValueSubtypeOfDetails(nbf *NomsBinFormat, v Value, t *Type) (bool, bool, error)
- func NewStreamingList(ctx context.Context, vrw ValueReadWriter, ae *atomicerr.AtomicError, ...) <-chan List
- func NewStreamingSet(ctx context.Context, vrw ValueReadWriter, ae *atomicerr.AtomicError, ...) <-chan Set
- func PanicIfDangling(ctx context.Context, unresolved hash.HashSet, cs chunks.ChunkStore)
- func RegisterHRSCommenter(typename, unique string, commenter HRSCommenter)
- func SearchWithErroringLess(n int, f func(i int) (bool, error)) (int, error)
- func SerialCommitParentAddrs(nbf *NomsBinFormat, sm SerialMessage) ([]hash.Hash, error)
- func SortWithErroringLess(data SortData) error
- func TestWithSmallChunks(cb func())
- func UnregisterHRSCommenter(typename, unique string)
- func ValueCanBePathIndex(v Value) bool
- func VisitMapLevelOrder(m Map, cb func(h hash.Hash) (int64, error)) (int64, int64, error)
- func VisitMapLevelOrderSized(ms []Map, batchSize int, cb func(h hash.Hash) (int64, error)) (int64, int64, error)
- func WalkAddrs(v Value, nbf *NomsBinFormat, cb func(h hash.Hash, isleaf bool)) error
- func WalkAddrsForChunkStore(cs chunks.ChunkStore) (func(chunks.Chunk, func(h hash.Hash, isleaf bool) error) error, error)
- func WalkAddrsForNBF(nbf *NomsBinFormat) func(chunks.Chunk, func(h hash.Hash, isleaf bool) error) error
- func WriteEWKBHeader(v interface{}, buf []byte)
- func WriteEWKBLineData(l Linestring, buf []byte)
- func WriteEWKBPointData(p Point, buf []byte)
- func WriteEWKBPolyData(p Polygon, buf []byte)
- func WriteEncodedValue(ctx context.Context, w io.Writer, v Value) error
- func WriteEncodedValueMaxLines(ctx context.Context, w io.Writer, v Value, maxLines uint32) error
- func WriteValueStats(ctx context.Context, w io.Writer, v Value, vr ValueReader) error
- type AppliedEditStats
- type AtAnnotation
- type Blob
- func (b Blob) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
- func (b Blob) Concat(ctx context.Context, other Blob) (Blob, error)
- func (b Blob) Copy(ctx context.Context, w io.Writer) (int64, error)
- func (b Blob) CopyReadAhead(ctx context.Context, w io.Writer, chunkSize uint64, concurrency int) (int64, error)
- func (b Blob) DebugText() string
- func (b Blob) HumanReadableString() string
- func (b Blob) Kind() NomsKind
- func (b Blob) Len() uint64
- func (b Blob) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (b Blob) ReadAt(ctx context.Context, p []byte, off int64) (n int, err error)
- func (b Blob) Reader(ctx context.Context) *BlobReader
- func (b Blob) String() string
- func (b Blob) Value(ctx context.Context) (Value, error)
- type BlobReader
- type Bool
- func (b Bool) Equals(other Value) bool
- func (b Bool) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (b Bool) HumanReadableString() string
- func (b Bool) Kind() NomsKind
- func (b Bool) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (b Bool) Value(ctx context.Context) (Value, error)
- type Closer
- type CodecReader
- type Collection
- type CompoundDesc
- type CreateEditAcc
- type CycleDesc
- type Decimal
- func (v Decimal) Equals(other Value) bool
- func (v Decimal) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Decimal) HumanReadableString() string
- func (v Decimal) Kind() NomsKind
- func (v Decimal) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Decimal) Value(ctx context.Context) (Value, error)
- type DecodedChunk
- type DiffChangeType
- type DumbEditAccumulator
- func (dumb *DumbEditAccumulator) AddEdit(k LesserValuable, v Valuable)
- func (dumb *DumbEditAccumulator) Close(ctx context.Context) error
- func (dumb *DumbEditAccumulator) EditsAdded() int
- func (dumb *DumbEditAccumulator) FinishedEditing() (EditProvider, error)
- func (dumb *DumbEditAccumulator) Next() (*KVP, error)
- func (dumb *DumbEditAccumulator) ReachedEOF() bool
- type EditAccumulator
- type EditDistanceEqualsFn
- type EditProvider
- type EmptyEditProvider
- type EmptyMapIterator
- type Emptyable
- type FieldMap
- type FieldPath
- type Float
- func (v Float) Equals(other Value) bool
- func (v Float) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Float) HumanReadableString() string
- func (v Float) Kind() NomsKind
- func (v Float) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Float) Value(ctx context.Context) (Value, error)
- type Geometry
- func (v Geometry) Equals(other Value) bool
- func (v Geometry) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Geometry) HumanReadableString() string
- func (v Geometry) Kind() NomsKind
- func (v Geometry) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Geometry) Value(ctx context.Context) (Value, error)
- type HRSCommenter
- type HashFilterFunc
- type HashIndexPath
- type IndexPath
- type InlineBlob
- func (v InlineBlob) Equals(other Value) bool
- func (v InlineBlob) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v InlineBlob) HumanReadableString() string
- func (v InlineBlob) Kind() NomsKind
- func (v InlineBlob) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v InlineBlob) Value(ctx context.Context) (Value, error)
- type Int
- type IntersectionIterator
- type JSON
- func (t JSON) Compare(other JSON) (int, error)
- func (t JSON) CopyOf(vrw ValueReadWriter) JSON
- func (t JSON) Empty() bool
- func (v JSON) Equals(other Value) bool
- func (t JSON) Format() *NomsBinFormat
- func (v JSON) Hash(*NomsBinFormat) (hash.Hash, error)
- func (t JSON) HumanReadableString() string
- func (t JSON) Inner() (Value, error)
- func (v JSON) IsZeroValue() bool
- func (t JSON) Kind() NomsKind
- func (t JSON) Len() uint64
- func (t JSON) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (t JSON) Value(ctx context.Context) (Value, error)
- type KVP
- type KVPSlice
- type KVPSort
- type LesserValuable
- type Linestring
- func (v Linestring) Equals(other Value) bool
- func (v Linestring) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Linestring) HumanReadableString() string
- func (v Linestring) Kind() NomsKind
- func (v Linestring) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Linestring) Value(ctx context.Context) (Value, error)
- type List
- func (l List) Concat(ctx context.Context, other List) (List, error)
- func (l List) Diff(ctx context.Context, last List, changes chan<- Splice) error
- func (l List) DiffWithLimit(ctx context.Context, last List, changes chan<- Splice, ...) error
- func (l List) Edit() *ListEditor
- func (l List) Format() *NomsBinFormat
- func (l List) Get(ctx context.Context, idx uint64) (Value, error)
- func (l List) HumanReadableString() string
- func (l List) Iter(ctx context.Context, f func(v Value, index uint64) (stop bool, err error)) error
- func (l List) IterAll(ctx context.Context, f func(v Value, index uint64) error) error
- func (l List) IterRange(ctx context.Context, startIdx, endIdx uint64, ...) error
- func (l List) Iterator(ctx context.Context) (ListIterator, error)
- func (l List) IteratorAt(ctx context.Context, index uint64) (ListIterator, error)
- func (l List) String() string
- func (l List) ToSet(ctx context.Context) (Set, error)
- func (l List) Value(ctx context.Context) (Value, error)
- type ListEditor
- func (le *ListEditor) Append(vs ...Valuable) *ListEditor
- func (le *ListEditor) Get(ctx context.Context, idx uint64) (Valuable, error)
- func (le *ListEditor) Insert(idx uint64, vs ...Valuable) *ListEditor
- func (le *ListEditor) Kind() NomsKind
- func (le *ListEditor) Len() uint64
- func (le *ListEditor) List(ctx context.Context) (List, error)
- func (le *ListEditor) Remove(start uint64, end uint64) *ListEditor
- func (le *ListEditor) RemoveAt(idx uint64) *ListEditor
- func (le *ListEditor) Set(idx uint64, v Valuable) *ListEditor
- func (le *ListEditor) Splice(idx uint64, deleteCount uint64, vs ...Valuable) *ListEditor
- func (le *ListEditor) Value(ctx context.Context) (Value, error)
- type ListIterator
- type Map
- func (m Map) Any(ctx context.Context, cb func(k, v Value) bool) (yep bool, err error)
- func (m Map) At(ctx context.Context, idx uint64) (key, value Value, err error)
- func (m Map) BufferedIterator(ctx context.Context) (MapIterator, error)
- func (m Map) BufferedIteratorAt(ctx context.Context, pos uint64) (MapIterator, error)
- func (m Map) Diff(ctx context.Context, last Map, changes chan<- ValueChanged) error
- func (m Map) DiffLeftRight(ctx context.Context, last Map, changes chan<- ValueChanged) error
- func (m Map) DiffLeftRightInRange(ctx context.Context, last Map, start Value, inRange ValueInRange, ...) error
- func (m Map) Edit() *MapEditor
- func (m Map) Empty() bool
- func (m Map) First(ctx context.Context) (Value, Value, error)
- func (m Map) Format() *NomsBinFormat
- func (m Map) Has(ctx context.Context, key Value) (bool, error)
- func (m Map) HumanReadableString() string
- func (m Map) IndexForKey(ctx context.Context, key Value) (int64, error)
- func (m Map) Iter(ctx context.Context, cb mapIterCallback) error
- func (m Map) IterAll(ctx context.Context, cb mapIterAllCallback) error
- func (m Map) IterFrom(ctx context.Context, start Value, cb mapIterCallback) error
- func (m Map) IterRange(ctx context.Context, startIdx, endIdx uint64, cb mapIterAllCallback) error
- func (m Map) Iterator(ctx context.Context) (MapIterator, error)
- func (m Map) IteratorAt(ctx context.Context, pos uint64) (MapIterator, error)
- func (m Map) IteratorBackFrom(ctx context.Context, key Value) (MapIterator, error)
- func (m Map) IteratorFrom(ctx context.Context, key Value) (MapIterator, error)
- func (m Map) Last(ctx context.Context) (Value, Value, error)
- func (m Map) MaybeGet(ctx context.Context, key Value) (v Value, ok bool, err error)
- func (m Map) MaybeGetTuple(ctx context.Context, key Tuple) (v Tuple, ok bool, err error)
- func (m Map) RangeIterator(ctx context.Context, startIdx, endIdx uint64) (MapTupleIterator, error)
- func (m Map) String() string
- func (m Map) Value(ctx context.Context) (Value, error)
- type MapEditor
- func (med *MapEditor) Close(ctx context.Context) error
- func (med *MapEditor) Format() *NomsBinFormat
- func (med *MapEditor) Map(ctx context.Context) (Map, error)
- func (med *MapEditor) NumEdits() int64
- func (med *MapEditor) Remove(k LesserValuable) *MapEditor
- func (med *MapEditor) Set(k LesserValuable, v Valuable) *MapEditor
- func (med *MapEditor) SetM(kv ...Valuable) *MapEditor
- type MapIterator
- type MapTupleIterator
- type MarshalCallback
- type NomsBinFormat
- type NomsKind
- type Null
- func (v Null) Equals(other Value) bool
- func (v Null) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Null) HumanReadableString() string
- func (v Null) Kind() NomsKind
- func (v Null) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Null) Value(ctx context.Context) (Value, error)
- type Path
- type PathPart
- type Point
- func (v Point) Equals(other Value) bool
- func (v Point) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Point) HumanReadableString() string
- func (v Point) Kind() NomsKind
- func (v Point) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Point) Value(ctx context.Context) (Value, error)
- type Polygon
- func (v Polygon) Equals(other Value) bool
- func (v Polygon) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Polygon) HumanReadableString() string
- func (v Polygon) Kind() NomsKind
- func (v Polygon) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Polygon) Value(ctx context.Context) (Value, error)
- type PrimitiveDesc
- type Ref
- func (v Ref) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
- func (v Ref) Equals(other Value) bool
- func (r Ref) Format() *NomsBinFormat
- func (v Ref) Hash(*NomsBinFormat) (hash.Hash, error)
- func (r Ref) Height() uint64
- func (r Ref) HumanReadableString() string
- func (v Ref) IsZeroValue() bool
- func (v Ref) Kind() NomsKind
- func (v Ref) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (r Ref) String() string
- func (r Ref) TargetHash() hash.Hash
- func (r Ref) TargetType() (*Type, error)
- func (r Ref) TargetValue(ctx context.Context, vr ValueReader) (Value, error)
- func (r Ref) Value(ctx context.Context) (Value, error)
- type RefCallback
- type RefSlice
- type SerialMessage
- func (sm SerialMessage) Equals(other Value) bool
- func (sm SerialMessage) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (sm SerialMessage) HumanReadableString() string
- func (sm SerialMessage) Kind() NomsKind
- func (sm SerialMessage) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (sm SerialMessage) Value(ctx context.Context) (Value, error)
- type Set
- func (s Set) At(ctx context.Context, idx uint64) (Value, error)
- func (s Set) Diff(ctx context.Context, last Set, changes chan<- ValueChanged) error
- func (s Set) DiffLeftRight(ctx context.Context, last Set, changes chan<- ValueChanged) error
- func (s Set) Edit() *SetEditor
- func (s Set) First(ctx context.Context) (Value, error)
- func (s Set) Format() *NomsBinFormat
- func (s Set) Has(ctx context.Context, v Value) (bool, error)
- func (s Set) HumanReadableString() string
- func (s Set) Iter(ctx context.Context, cb setIterCallback) error
- func (s Set) IterAll(ctx context.Context, cb setIterAllCallback) error
- func (s Set) Iterator(ctx context.Context) (SetIterator, error)
- func (s Set) IteratorAt(ctx context.Context, idx uint64) (SetIterator, error)
- func (s Set) IteratorFrom(ctx context.Context, val Value) (SetIterator, error)
- func (s Set) String() string
- func (s Set) Value(ctx context.Context) (Value, error)
- type SetEditor
- func (se *SetEditor) Has(ctx context.Context, v Value) (bool, error)
- func (se *SetEditor) Insert(vs ...Value) (*SetEditor, error)
- func (se *SetEditor) Kind() NomsKind
- func (se *SetEditor) Remove(vs ...Value) (*SetEditor, error)
- func (se *SetEditor) Set(ctx context.Context) (Set, error)
- func (se *SetEditor) Value(ctx context.Context) (Value, error)
- type SetIterator
- type SortData
- type Splice
- type StreamingMap
- type String
- func (s String) Equals(other Value) bool
- func (s String) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (s String) HumanReadableString() string
- func (s String) Kind() NomsKind
- func (s String) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (s String) Value(ctx context.Context) (Value, error)
- type Struct
- func (v Struct) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
- func (s Struct) Delete(n string) (Struct, error)
- func (s Struct) Diff(ctx context.Context, last Struct, changes chan<- ValueChanged) error
- func (s Struct) Empty() bool
- func (v Struct) Equals(other Value) bool
- func (s Struct) Format() *NomsBinFormat
- func (v Struct) Hash(*NomsBinFormat) (hash.Hash, error)
- func (s Struct) HumanReadableString() string
- func (v Struct) IsZeroValue() bool
- func (s Struct) IterFields(cb func(name string, value Value) error) error
- func (v Struct) Kind() NomsKind
- func (s Struct) Len() int
- func (v Struct) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (s Struct) MaybeGet(n string) (v Value, found bool, err error)
- func (s Struct) Name() string
- func (s Struct) Set(n string, v Value) (Struct, error)
- func (s Struct) String() string
- func (s Struct) Value(ctx context.Context) (Value, error)
- type StructData
- type StructDesc
- type StructField
- type StructTemplate
- type TargetAnnotation
- type Timestamp
- func (v Timestamp) Equals(other Value) bool
- func (v Timestamp) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Timestamp) HumanReadableString() string
- func (v Timestamp) Kind() NomsKind
- func (v Timestamp) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Timestamp) String() string
- func (v Timestamp) Value(ctx context.Context) (Value, error)
- type Tuple
- func (t Tuple) Append(vals ...Value) (Tuple, error)
- func (t Tuple) AsSlice() (TupleValueSlice, error)
- func (t Tuple) AsSubslice(n uint64) (TupleValueSlice, error)
- func (t Tuple) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
- func (t Tuple) Contains(v Value) (bool, error)
- func (t Tuple) CopyOf(vrw ValueReadWriter) Tuple
- func (t Tuple) Empty() bool
- func (v Tuple) Equals(other Value) bool
- func (t Tuple) Format() *NomsBinFormat
- func (t Tuple) Get(n uint64) (Value, error)
- func (v Tuple) Hash(*NomsBinFormat) (hash.Hash, error)
- func (t Tuple) HumanReadableString() string
- func (v Tuple) IsZeroValue() bool
- func (t Tuple) IterFields(cb func(index uint64, value Value) (stop bool, err error)) error
- func (t Tuple) Iterator() (*TupleIterator, error)
- func (t Tuple) IteratorAt(pos uint64) (*TupleIterator, error)
- func (v Tuple) Kind() NomsKind
- func (t Tuple) Len() uint64
- func (t Tuple) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (t Tuple) PrefixEquals(ctx context.Context, other Tuple, prefixCount uint64) (bool, error)
- func (t Tuple) Set(n uint64, v Value) (Tuple, error)
- func (t Tuple) Size() int
- func (t Tuple) StartsWith(otherTuple Tuple) bool
- func (t Tuple) String() string
- func (t Tuple) TupleCompare(nbf *NomsBinFormat, otherTuple Tuple) (int, error)
- func (t Tuple) Value(ctx context.Context) (Value, error)
- func (t Tuple) WalkValues(ctx context.Context, cb ValueCallback) error
- type TupleFactory
- type TupleIterator
- func (itr *TupleIterator) CodecReader() (CodecReader, uint64)
- func (itr *TupleIterator) HasMore() bool
- func (itr *TupleIterator) InitForTuple(t Tuple) error
- func (itr *TupleIterator) InitForTupleAt(t Tuple, pos uint64) error
- func (itr *TupleIterator) Len() uint64
- func (itr *TupleIterator) Next() (uint64, Value, error)
- func (itr *TupleIterator) NextUint64() (pos uint64, val uint64, err error)
- func (itr *TupleIterator) Pos() uint64
- func (itr *TupleIterator) Skip() error
- type TupleReadCloser
- type TupleReader
- type TupleReadingEditProvider
- type TupleRowStorage
- func (v TupleRowStorage) Equals(other Value) bool
- func (v TupleRowStorage) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v TupleRowStorage) HumanReadableString() string
- func (v TupleRowStorage) Kind() NomsKind
- func (v TupleRowStorage) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v TupleRowStorage) Value(ctx context.Context) (Value, error)
- type TupleSlice
- type TupleSort
- type TupleValueSlice
- type TupleWriteCloser
- type TupleWriter
- type Type
- func MakeCycleType(name string) *Type
- func MakeListType(elemType *Type) (*Type, error)
- func MakeMapType(keyType, valType *Type) (*Type, error)
- func MakePrimitiveType(k NomsKind) (*Type, error)
- func MakeRefType(elemType *Type) (*Type, error)
- func MakeSetType(elemType *Type) (*Type, error)
- func MakeStructType(name string, fields ...StructField) (*Type, error)
- func MakeStructTypeFromFields(name string, fields FieldMap) (*Type, error)
- func MakeUnionType(elemTypes ...*Type) (*Type, error)
- func TypeOf(v Value) (*Type, error)
- func (t *Type) Describe(ctx context.Context) (string, error)
- func (t *Type) Equals(other Value) (res bool)
- func (t *Type) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (t *Type) HumanReadableString() string
- func (t *Type) Kind() NomsKind
- func (t *Type) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (t *Type) String() string
- func (t *Type) TargetKind() NomsKind
- func (t *Type) Value(ctx context.Context) (Value, error)
- type TypeAnnotation
- type TypeDesc
- type UUID
- func (v UUID) Equals(other Value) bool
- func (v UUID) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v UUID) HumanReadableString() string
- func (v UUID) Kind() NomsKind
- func (v UUID) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v UUID) String() string
- func (v UUID) Value(ctx context.Context) (Value, error)
- type Uint
- func (v Uint) Equals(other Value) bool
- func (v Uint) Hash(nbf *NomsBinFormat) (hash.Hash, error)
- func (v Uint) HumanReadableString() string
- func (v Uint) Kind() NomsKind
- func (v Uint) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
- func (v Uint) Value(ctx context.Context) (Value, error)
- type UnionIterator
- type ValidatingDecoder
- type Valuable
- type Value
- type ValueCallback
- type ValueChanged
- type ValueInRange
- type ValueReadWriter
- type ValueReader
- type ValueSlice
- type ValueSort
- type ValueStats
- type ValueStore
- func (lvs *ValueStore) ChunkStore() chunks.ChunkStore
- func (lvs *ValueStore) Close() error
- func (lvs *ValueStore) Commit(ctx context.Context, current, last hash.Hash) (bool, error)
- func (lvs *ValueStore) Flush(ctx context.Context) error
- func (lvs *ValueStore) Format() *NomsBinFormat
- func (lvs *ValueStore) GC(ctx context.Context, oldGenRefs, newGenRefs hash.HashSet) error
- func (lvs *ValueStore) ReadManyValues(ctx context.Context, hashes hash.HashSlice) (ValueSlice, error)
- func (lvs *ValueStore) ReadValue(ctx context.Context, h hash.Hash) (Value, error)
- func (lvs *ValueStore) Rebase(ctx context.Context) error
- func (lvs *ValueStore) Root(ctx context.Context) (hash.Hash, error)
- func (lvs *ValueStore) SetEnforceCompleteness(enforce bool)
- func (lvs *ValueStore) WriteValue(ctx context.Context, v Value) (Ref, error)
- type ValueWriter
Constants ¶
const ( GigsHalf = 1 << 29 Gigs2 = 1 << 31 )
const ( DEFAULT_MAX_SPLICE_MATRIX_SIZE = 2e7 SPLICE_UNASSIGNED = math.MaxUint64 UNCHANGED = 0 UPDATED = 1 INSERTED = 2 REMOVED = 3 )
const (
LengthSize = 4
)
const SerialMessageRefHeight = 1024
Refs in SerialMessage do not have height. This should be taller than any true Ref height we expect to see in a RootValue.
Variables ¶
var EmptyStructType, _ = MakeStructType("")
var ErrKeysNotOrdered = errors.New("streaming map keys not ordered")
var ErrNotAMapOfTuples = errors.New("type error: not a map of tuples")
var ErrUnknownType = errors.New("unknown type $@")
var ErrUnsupportedFormat = errors.New("operation not supported for format '__DOLT_1__' ")
var Format_7_18 = &NomsBinFormat{}
var Format_DOLT_1 = &NomsBinFormat{formatTag_DOLT_1}
var Format_DOLT_DEV = &NomsBinFormat{formatTag_DOLT_DEV}
var Format_LD_1 = &NomsBinFormat{formatTag_LD_1}
var KindToString = map[NomsKind]string{ UnknownKind: "unknown", BlobKind: "Blob", BoolKind: "Bool", CycleKind: "Cycle", ListKind: "List", MapKind: "Map", FloatKind: "Float", RefKind: "Ref", SetKind: "Set", StructKind: "Struct", StringKind: "String", TypeKind: "Type", UnionKind: "Union", ValueKind: "Value", UUIDKind: "UUID", IntKind: "Int", UintKind: "Uint", NullKind: "Null", TupleKind: "Tuple", InlineBlobKind: "InlineBlob", TimestampKind: "Timestamp", DecimalKind: "Decimal", JSONKind: "JSON", GeometryKind: "Geometry", PointKind: "Point", LinestringKind: "Linestring", PolygonKind: "Polygon", SerialMessageKind: "SerialMessage", TupleRowStorageKind: "TupleRowStorage", }
var KindToType = make([]Value, 255)
var KindToTypeSlice []Value
var MaxPrimitiveKind int
var PrimitiveKindMask []bool
var PrimitiveTypeMap = map[NomsKind]*Type{ ValueKind: makePrimitiveType(ValueKind), }
PrimitiveTypeMap auto populates with Value types that return true from isPrimitive(). Only include a type here manually if it has no associated Value type.
var SupportedKinds = make([]bool, 255)
var TupleItrPool = &sync.Pool{New: newTupleIterator}
Functions ¶
func ApplyEdits ¶
func ApplyEdits(ctx context.Context, edits EditProvider, m Map) (Map, AppliedEditStats, error)
ApplyEdits applies all the edits to a given Map and returns the resulting map, and some statistics about the edits that were applied.
func ApplyNEdits ¶
func ApplyNEdits(ctx context.Context, edits EditProvider, m Map, numEdits int64) (Map, AppliedEditStats, error)
func ContainCommonSupertype ¶
func ContainCommonSupertype(nbf *NomsBinFormat, a, b *Type) bool
ContainCommonSupertype returns true if it's possible to synthesize a non-trivial (i.e. not empty) supertype from types |a| and |b|.
It is useful for determining whether a subset of values can be extracted from one object to produce another object.
The rules for determining whether |a| and |b| intersect are:
- if either type is Value, return true
- if either type is Union, return true iff at least one variant of |a| intersects with one variant of |b|
- if |a| & |b| are not the same kind, return false
- else
- if both are structs, return true iff their names are equal or one name is "", they share a field name and the type of that field intersects
- if both are refs, sets or lists, return true iff the element type intersects
- if both are maps, return true iff they have a key with the same type and value types that intersect
- else return true
func EncodeValue ¶
func EncodeValue(v Value, nbf *NomsBinFormat) (chunks.Chunk, error)
func EncodedValue ¶
EncodedValue returns a string containing the serialization of a value.
func EncodedValueMaxLines ¶
EncodedValueMaxLines returns a string containing the serialization of a value. The string is truncated at |maxLines|.
func EscapeStructField ¶
EscapeStructField escapes names for use as noms structs with regards to non CSV imported data. Disallowed characters are encoded as 'Q<hex-encoded-utf8-bytes>'. Note that Q itself is also escaped since it is the escape character.
func HasStructCycles ¶
HasStructCycles determines if the type contains any struct cycles.
func IsFormat_DOLT_1 ¶
func IsFormat_DOLT_1(nbf *NomsBinFormat) bool
func IsGeometryKind ¶
func IsPrimitiveKind ¶
IsPrimitiveKind returns true if k represents a Noms primitive type, which excludes collections (List, Map, Set), Refs, Structs, Symbolic and Unresolved types.
func IsSubtype ¶
func IsSubtype(nbf *NomsBinFormat, requiredType, concreteType *Type) bool
IsSubtype determines whether concreteType is a subtype of requiredType. For example, `Float` is a subtype of `Float | String`.
func IsSubtypeDisallowExtraStructFields ¶
func IsSubtypeDisallowExtraStructFields(nbf *NomsBinFormat, requiredType, concreteType *Type) bool
IsSubtypeDisallowExtraFields is a slightly weird variant of IsSubtype. It returns true IFF IsSubtype(requiredType, concreteType) AND Structs in concreteType CANNOT have field names absent in requiredType ISSUE: https://github.com/attic-labs/noms/issues/3446
func IsValidStructFieldName ¶
IsValidStructFieldName returns whether the name is valid as a field name in a struct. Valid names must start with `a-zA-Z` and after that `a-zA-Z0-9_`.
func IsValueSubtypeOf ¶
func IsValueSubtypeOf(nbf *NomsBinFormat, v Value, t *Type) (bool, error)
func IsValueSubtypeOfDetails ¶
IsValueSubtypeOfDetails returns two values:
isSub - which indicates whether v is a subtype of t. hasExtra - which indicates whether v has additional fields. This field has no meaning if IsSub is false.
For example, given the following data:
type1 := struct S { v := Struct S1 { a Float | string a: "hello" b ?int b: 2 } }
IsValueSubtypeOfDetails(v, type1) would return isSub == true, and hasExtra == false
And given these types:
type2 := struct S { v := Struct S1 { a Float | string a: "hello" b ?int b: 2 } c: "hello again" }
IsValueSubtypeOfDetails(v, type1) would return isSub == true, and hasExtra == true
func NewStreamingList ¶
func NewStreamingList(ctx context.Context, vrw ValueReadWriter, ae *atomicerr.AtomicError, values <-chan Value) <-chan List
NewStreamingList creates a new List, populated with values, chunking if and when needed. As chunks are created, they're written to vrw -- including the root chunk of the list. Once the caller has closed values, the caller can read the completed List from the returned channel.
func NewStreamingSet ¶
func NewStreamingSet(ctx context.Context, vrw ValueReadWriter, ae *atomicerr.AtomicError, vChan <-chan Value) <-chan Set
NewStreamingSet takes an input channel of values and returns a output channel that will produce a finished Set. Values that are sent to the input channel must be in Noms sortorder, adding values to the input channel out of order will result in a panic. Once the input channel is closed by the caller, a finished Set will be sent to the output channel. See graph_builder.go for building collections with values that are not in order.
func PanicIfDangling ¶
func RegisterHRSCommenter ¶
func RegisterHRSCommenter(typename, unique string, commenter HRSCommenter)
RegisterHRSCommenter is called to with three arguments:
typename: the name of the struct this function will be applied to unique: an arbitrary string to differentiate functions that should be applied to different structs that have the same name (e.g. two implementations of the "Employee" type. commenter: an interface with a 'Comment()' function that gets called for all Values with this name. The function should verify the type of the Value and, if appropriate, return a non-empty string to be appended as the comment
func SearchWithErroringLess ¶
func SerialCommitParentAddrs ¶
func SerialCommitParentAddrs(nbf *NomsBinFormat, sm SerialMessage) ([]hash.Hash, error)
func SortWithErroringLess ¶
func TestWithSmallChunks ¶
func TestWithSmallChunks(cb func())
TestWithSmallChunks allows testing with small chunks outside of pkg types.
func UnregisterHRSCommenter ¶
func UnregisterHRSCommenter(typename, unique string)
UnregisterHRSCommenter will remove a commenter function for a specified typename/unique string combination.
func ValueCanBePathIndex ¶
func VisitMapLevelOrder ¶
VisitMapLevelOrder writes hashes of internal node chunks to a writer delimited with a newline character and returns the number or chunks written and the total number of bytes written or an error if encountered
func VisitMapLevelOrderSized ¶
func VisitMapLevelOrderSized(ms []Map, batchSize int, cb func(h hash.Hash) (int64, error)) (int64, int64, error)
VisitMapLevelOrderSized passes hashes of internal node chunks to a callback in level order, batching and flushing chunks to prevent large levels from consuming excessive memory. It returns the total number of chunks and bytes read, or an error.
func WalkAddrsForChunkStore ¶
func WalkAddrsForChunkStore(cs chunks.ChunkStore) (func(chunks.Chunk, func(h hash.Hash, isleaf bool) error) error, error)
Returns a function that can be used to walk the hashes of all the Refs of a given Chunk. The callback also takes a boolean parameter |isleaf|, which is true when the ref points to a known leaf chunk. This function is meant to decouple callers from the types package itself, and so the callback itself does not take |types.Ref| values.
func WalkAddrsForNBF ¶
func WriteEWKBHeader ¶
func WriteEWKBHeader(v interface{}, buf []byte)
WriteEWKBHeader writes the SRID, endianness, and type to the byte buffer This function assumes v is a valid spatial type
func WriteEWKBLineData ¶
func WriteEWKBLineData(l Linestring, buf []byte)
WriteEWKBLineData converts a Line into a byte array in EWKB format
func WriteEWKBPointData ¶
WriteEWKBPointData converts a Point into a byte array in EWKB format Very similar to function in GMS
func WriteEWKBPolyData ¶
WriteEWKBPolyData converts a Polygon into a byte array in EWKB format
func WriteEncodedValue ¶
WriteEncodedValue writes the serialization of a value
func WriteEncodedValueMaxLines ¶
WriteEncodedValueMaxLines writes the serialization of a value. Writing will be stopped and an error returned after |maxLines|.
func WriteValueStats ¶
Types ¶
type AppliedEditStats ¶
type AppliedEditStats struct { // Additions counts the number of elements added to the map Additions int64 // Modifications counts the number of map entries that were modified Modifications int64 // SamVal counts the number of edits that had no impact because a value was set to the same value that is already // stored in the map SameVal int64 // Deletions counts the number of items deleted from the map Deletions int64 // NonexistantDeletes counts the number of items where a deletion was attempted, but the key didn't exist in the map // so there was no impact NonExistentDeletes int64 }
AppliedEditStats contains statistics on what edits were applied in types.ApplyEdits
func (AppliedEditStats) Add ¶
func (stats AppliedEditStats) Add(other AppliedEditStats) AppliedEditStats
Add adds two AppliedEditStats structures member by member.
type AtAnnotation ¶
type AtAnnotation struct { // Index is the position to resolve at. If negative, it means an index // relative to the end of the collection. Index int64 // IntoKey see IndexPath.IntoKey. IntoKey bool }
AtAnnotation is a PathPart annotation that gets the value of a collection at a position, rather than a key. This is equivalent to IndexPath for lists, but different for sets and maps.
func NewAtAnnotation ¶
func NewAtAnnotation(idx int64) AtAnnotation
func (AtAnnotation) Resolve ¶
func (ann AtAnnotation) Resolve(ctx context.Context, v Value, vr ValueReader) (Value, error)
func (AtAnnotation) String ¶
func (ann AtAnnotation) String() (str string)
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
Blob represents a list of Blobs.
func NewBlob ¶
NewBlob creates a Blob by reading from every Reader in rs and concatenating the result. NewBlob uses one goroutine per Reader.
func NewEmptyBlob ¶
func NewEmptyBlob(vrw ValueReadWriter) (Blob, error)
func (Blob) Compare ¶
func (b Blob) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
func (Blob) Concat ¶
Concat returns a new Blob comprised of this joined with other. It only needs to visit the rightmost prolly tree chunks of this Blob, and the leftmost prolly tree chunks of other, so it's efficient.
func (Blob) CopyReadAhead ¶
func (b Blob) CopyReadAhead(ctx context.Context, w io.Writer, chunkSize uint64, concurrency int) (int64, error)
CopyReadAhead copies the entire contents of |b| to |w|, and attempts to stay |concurrency| |chunkSize| blocks of bytes ahead of the last byte written to |w|.
func (Blob) HumanReadableString ¶
func (Blob) Less ¶
func (b Blob) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
Less implements the LesserValuable interface.
type BlobReader ¶
type BlobReader struct {
// contains filtered or unexported fields
}
type Bool ¶
type Bool bool
Bool is a Noms Value wrapper around the primitive bool type.
func (Bool) HumanReadableString ¶
func (Bool) Less ¶
func (b Bool) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Closer ¶
type Closer interface { // Close should release any underlying resources Close(context.Context) error }
Closer is an interface for a class that can be closed
type CodecReader ¶
type CodecReader interface { PeekKind() NomsKind ReadKind() NomsKind SkipValue(nbf *NomsBinFormat) error ReadUint() uint64 ReadInt() int64 ReadFloat(nbf *NomsBinFormat) float64 ReadBool() bool ReadUUID() uuid.UUID ReadString() string ReadInlineBlob() []byte ReadTimestamp() (time.Time, error) ReadDecimal() (decimal.Decimal, error) ReadGeometry() (Geometry, error) ReadPoint() (Point, error) ReadLinestring() (Linestring, error) ReadPolygon() (Polygon, error) ReadBlob() (Blob, error) ReadJSON() (JSON, error) }
type Collection ¶
type Collection interface { Value Emptyable Len() uint64 // contains filtered or unexported methods }
func LoadLeafNodes ¶
func LoadLeafNodes(ctx context.Context, cols []Collection, startIdx, endIdx uint64) ([]Collection, uint64, error)
LoadLeafNodes loads the set of leaf nodes which contain the items [startIdx -> endIdx). Returns the set of nodes and the offset within the first sequence which corresponds to |startIdx|.
type CompoundDesc ¶
type CompoundDesc struct { ElemTypes typeSlice // contains filtered or unexported fields }
CompoundDesc describes a List, Map, Set, Ref, or Union type. ElemTypes indicates what type or types are in the container indicated by kind, e.g. Map key and value or Set element.
func (CompoundDesc) Kind ¶
func (c CompoundDesc) Kind() NomsKind
type CreateEditAcc ¶
type CreateEditAcc func(nbf *NomsBinFormat) EditAccumulator
CreateEditAcc defines a factory method for EditAccumulator creation
var CreateEditAccForMapEdits CreateEditAcc = NewDumbEditAccumulator
CreateEditAccForMapEdits allows users to define the EditAccumulator that should be used when creating a MapEditor via the Map.Edit method. In most cases you should call:
func init() { types.CreateEditAccForMapEdits = func() EditAccumulator { return edits.NewAsyncSortedEdits(10000, 4, 2) // configure your own constants } }
type Decimal ¶
func (Decimal) HumanReadableString ¶
func (Decimal) Less ¶
func (v Decimal) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type DecodedChunk ¶
DecodedChunk holds a pointer to a Chunk and the Value that results from calling DecodeFromBytes(c.Data()).
type DiffChangeType ¶
type DiffChangeType uint8
const ( DiffChangeAdded DiffChangeType = iota DiffChangeRemoved DiffChangeModified )
type DumbEditAccumulator ¶
type DumbEditAccumulator struct {
// contains filtered or unexported fields
}
DumbEditAccumulator is a simple EditAccumulator and EditProvider implementation that allows for more complex implementations to be put into other packages. It is fine for small edits, and tests, but edits.AsyncSortedEdits performs much better for large amounts of data
func (*DumbEditAccumulator) AddEdit ¶
func (dumb *DumbEditAccumulator) AddEdit(k LesserValuable, v Valuable)
AddEdit adds an edit to the list of edits
func (*DumbEditAccumulator) Close ¶
func (dumb *DumbEditAccumulator) Close(ctx context.Context) error
Close satisfies the EditAccumulator interface
func (*DumbEditAccumulator) EditsAdded ¶
func (dumb *DumbEditAccumulator) EditsAdded() int
EditsAdded returns the number of edits that have been added to this EditAccumulator
func (*DumbEditAccumulator) FinishedEditing ¶
func (dumb *DumbEditAccumulator) FinishedEditing() (EditProvider, error)
FinishEditing should be called when all edits have been added to get an EditProvider which provides the edits in sorted order. Adding more edits after calling FinishedEditing is an error
func (*DumbEditAccumulator) Next ¶
func (dumb *DumbEditAccumulator) Next() (*KVP, error)
Next returns the next KVP representing the next edit to be applied. Next will always return KVPs in key sorted order. Once all KVPs have been read io.EOF will be returned.
func (*DumbEditAccumulator) ReachedEOF ¶
func (dumb *DumbEditAccumulator) ReachedEOF() bool
ReachedEOF returns true once all data is exhausted. If ReachedEOF returns false that does not mean that there is more data, only that io.EOF has not been returned previously. If ReachedEOF returns true then all edits have been read
type EditAccumulator ¶
type EditAccumulator interface { // EditsAdded returns the number of edits that have been added to this EditAccumulator EditsAdded() int // AddEdit adds an edit to the list of edits. Not thread safe. AddEdit(k LesserValuable, v Valuable) // FinishedEditing should be called when all edits have been added to get an EditProvider which provides the // edits in sorted order. Adding more edits after calling FinishedEditing is an error. FinishedEditing() (EditProvider, error) // Close ensures that the accumulator is closed. Repeat calls are allowed. Not guaranteed to be thread-safe, thus // requires external synchronization. Close(context.Context) error }
EditAccumulator is an interface for a datastructure that can have edits added to it. Once all edits are added FinishedEditing can be called to get an EditProvider which provides the edits in sorted order
func NewDumbEditAccumulator ¶
func NewDumbEditAccumulator(nbf *NomsBinFormat) EditAccumulator
NewDumbEditAccumulator is a factory method for creation of DumbEditAccumulators
type EditDistanceEqualsFn ¶
type EditProvider ¶
type EditProvider interface { // Next returns the next KVP representing the next edit to be applied. Next will always return KVPs // in key sorted order. Once all KVPs have been read io.EOF will be returned. Next() (*KVP, error) // ReachedEOF returns true once all data is exhausted. If ReachedEOF returns false that does not mean that there // is more data, only that io.EOF has not been returned previously. If ReachedEOF returns true then all edits have // been read ReachedEOF() bool Close(ctx context.Context) error }
EditProvider is an interface which provides map edits as KVPs where each edit is a key and the new value associated with the key for inserts and updates. deletes are modeled as a key with no value
func TupleReaderAsEditProvider ¶
func TupleReaderAsEditProvider(rd TupleReader) EditProvider
type EmptyEditProvider ¶
type EmptyEditProvider struct{}
EmptyEditProvider is an EditProvider implementation that has no edits
func (EmptyEditProvider) Next ¶
func (eep EmptyEditProvider) Next() (*KVP, error)
Next will always return nil, io.EOF
func (EmptyEditProvider) ReachedEOF ¶
func (eep EmptyEditProvider) ReachedEOF() bool
ReachedEOF returns true once all data is exhausted. If ReachedEOF returns false that does not mean that there is more data, only that io.EOF has not been returned previously. If ReachedEOF returns true then all edits have been read
type EmptyMapIterator ¶
type EmptyMapIterator struct{}
type Emptyable ¶
type Emptyable interface {
Empty() bool
}
Emptyable is an interface for Values which may or may not be empty
type FieldPath ¶
type FieldPath struct { // The name of the field, e.g. `.Name`. Name string }
FieldPath references Struct field values by name.
func NewFieldPath ¶
type Float ¶
type Float float64
Float is a Noms Value wrapper around the primitive float64 type.
func (Float) HumanReadableString ¶
func (Float) Less ¶
func (v Float) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Geometry ¶
type Geometry struct {
Inner Value // Can be types.Point, types.Linestring, or types.Polygon
}
Geometry represents any of the types Point, Linestring, or Polygon. TODO: Generics maybe?
func (Geometry) HumanReadableString ¶
func (Geometry) Less ¶
func (v Geometry) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type HRSCommenter ¶
Function type for commenter functions
func GetHRSCommenters ¶
func GetHRSCommenters(typename string) []HRSCommenter
GetHRSCommenters the map of 'unique' strings to HRSCommentFunc for a specified typename.
type HashIndexPath ¶
type HashIndexPath struct { // The hash of the key or value to search for. Maps and Set are ordered, so // this in O(log(size)). Hash hash.Hash // Whether this index should resolve to the key of a map, given by a `@key` // annotation. Typically IntoKey is false, and indices would resolve to the // values. E.g. given `{a: 42}` and if the hash of `"a"` is `#abcd`, then // `[#abcd]` resolves to `42`. If IntoKey is true, then it resolves to `"a"`. // This is useful for when Map keys aren't primitive values, e.g. a struct, // since struct literals can't be spelled using a Path. IntoKey bool }
Indexes into Maps by the hash of a key, or a Set by the hash of a value.
func NewHashIndexPath ¶
func NewHashIndexPath(h hash.Hash) HashIndexPath
func (HashIndexPath) Resolve ¶
func (hip HashIndexPath) Resolve(ctx context.Context, v Value, vr ValueReader) (Value, error)
func (HashIndexPath) String ¶
func (hip HashIndexPath) String() (str string)
type IndexPath ¶
type IndexPath struct { // The value of the index, e.g. `[42]` or `["value"]`. If Index is a negative // number and the path is resolved in a List, it means index from the back. Index Value // Whether this index should resolve to the key of a map, given by a `@key` // annotation. Typically IntoKey is false, and indices would resolve to the // values. E.g. given `{a: 42}` then `["a"]` resolves to `42`. If IntoKey is // true, then it resolves to `"a"`. For IndexPath this isn't particularly // useful - it's mostly provided for consistency with HashIndexPath - but // note that given `{a: 42}` then `["b"]` resolves to nil, not `"b"`. IntoKey bool }
IndexPath ndexes into Maps and Lists by key or index.
func NewIndexPath ¶
type InlineBlob ¶
type InlineBlob []byte
func (InlineBlob) Equals ¶
func (v InlineBlob) Equals(other Value) bool
func (InlineBlob) Hash ¶
func (v InlineBlob) Hash(nbf *NomsBinFormat) (hash.Hash, error)
func (InlineBlob) HumanReadableString ¶
func (v InlineBlob) HumanReadableString() string
func (InlineBlob) Kind ¶
func (v InlineBlob) Kind() NomsKind
func (InlineBlob) Less ¶
func (v InlineBlob) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Int ¶
type Int int64
Int is a Noms Value wrapper around the primitive int32 type.
func (Int) HumanReadableString ¶
func (Int) Less ¶
func (v Int) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type IntersectionIterator ¶
type IntersectionIterator struct {
// contains filtered or unexported fields
}
IntersectionIterator only returns values that are returned in both of its child iterators. The values from Next() are returned in noms-defined order with all duplicates removed.
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
func NewJSONDoc ¶
func NewJSONDoc(nbf *NomsBinFormat, vrw ValueReadWriter, value Value) (JSON, error)
NewJSONDoc wraps |value| in a JSON value.
func NewTestJSONDoc ¶
func NewTestJSONDoc(nbf *NomsBinFormat, vrw ValueReadWriter, buf []byte) (JSON, error)
func (JSON) CopyOf ¶
func (t JSON) CopyOf(vrw ValueReadWriter) JSON
CopyOf creates a copy of a JSON. This is necessary in cases where keeping a reference to the original JSON is preventing larger objects from being collected.
func (JSON) Format ¶
func (t JSON) Format() *NomsBinFormat
Format returns this values NomsBinFormat.
func (JSON) HumanReadableString ¶
HumanReadableString implements the Value interface.
func (JSON) IsZeroValue ¶
func (v JSON) IsZeroValue() bool
IsZeroValue can be used to test if a Value is the same as T{}.
func (JSON) Less ¶
func (t JSON) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
Less implements the LesserValuable interface.
type KVP ¶
type KVP struct { // Key is the key Key LesserValuable // Val is the value Val Valuable }
KVP is a simple key value pair
type KVPSort ¶
type KVPSort struct { Values []KVP NBF *NomsBinFormat }
type LesserValuable ¶
type LesserValuable interface { Valuable // Less determines if this Noms value is less than another Noms value. // When comparing two Noms values and both are comparable and the same type (Bool, Float or // String) then the natural ordering is used. For other Noms values the Hash of the value is // used. When comparing Noms values of different type the following ordering is used: // Bool < Float < String < everything else. Less(nbf *NomsBinFormat, other LesserValuable) (bool, error) }
type Linestring ¶
Linestring is a Noms Value wrapper around a string.
func ParseEWKBLine ¶
func ParseEWKBLine(buf []byte, srid uint32) Linestring
ParseEWKBLine converts the data portion of a WKB point to Linestring Very similar logic to the function in GMS
func (Linestring) Equals ¶
func (v Linestring) Equals(other Value) bool
func (Linestring) Hash ¶
func (v Linestring) Hash(nbf *NomsBinFormat) (hash.Hash, error)
func (Linestring) HumanReadableString ¶
func (v Linestring) HumanReadableString() string
func (Linestring) Kind ¶
func (v Linestring) Kind() NomsKind
func (Linestring) Less ¶
func (v Linestring) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents a list or an array of Noms values. A list can contain zero or more values of zero or more types. The type of the list will reflect the type of the elements in the list. For example:
l := NewList(Float(1), Bool(true)) fmt.Println(l.Type().Describe()) // outputs List<Bool | Float>
Lists, like all Noms values are immutable so the "mutation" methods return a new list.
var EmptyList List
func NewList ¶
NewList creates a new List where the type is computed from the elements in the list, populated with values, chunking if and when needed.
func (List) Concat ¶
Concat returns a new List comprised of this joined with other. It only needs to visit the rightmost prolly tree chunks of this List, and the leftmost prolly tree chunks of other, so it's efficient.
func (List) Diff ¶
Diff streams the diff from last to the current list to the changes channel. Caller can close closeChan to cancel the diff operation.
func (List) DiffWithLimit ¶
func (l List) DiffWithLimit(ctx context.Context, last List, changes chan<- Splice, maxSpliceMatrixSize uint64) error
DiffWithLimit streams the diff from last to the current list to the changes channel. Caller can close closeChan to cancel the diff operation. The maxSpliceMatrixSize determines the how big of an edit distance matrix we are willing to compute versus just saying the thing changed.
func (List) Edit ¶
func (l List) Edit() *ListEditor
func (List) Format ¶
func (l List) Format() *NomsBinFormat
func (List) Get ¶
Get returns the value at the given index. If this list has been chunked then this will have to descend into the prolly-tree which leads to Get being O(depth).
func (List) HumanReadableString ¶
func (List) Iter ¶
Iter iterates over the list and calls f for every element in the list. If f returns true then the iteration stops.
func (List) IterAll ¶
IterAll iterates over the list and calls f for every element in the list. Unlike Iter there is no way to stop the iteration and all elements are visited.
func (List) Iterator ¶
func (l List) Iterator(ctx context.Context) (ListIterator, error)
Iterator returns a ListIterator which can be used to iterate efficiently over a list.
func (List) IteratorAt ¶
IteratorAt returns a ListIterator starting at index. If index is out of bound the iterator will have reached its end on creation.
type ListEditor ¶
type ListEditor struct {
// contains filtered or unexported fields
}
func NewListEditor ¶
func NewListEditor(l List) *ListEditor
func (*ListEditor) Append ¶
func (le *ListEditor) Append(vs ...Valuable) *ListEditor
func (*ListEditor) Insert ¶
func (le *ListEditor) Insert(idx uint64, vs ...Valuable) *ListEditor
func (*ListEditor) Kind ¶
func (le *ListEditor) Kind() NomsKind
func (*ListEditor) Len ¶
func (le *ListEditor) Len() uint64
func (*ListEditor) Remove ¶
func (le *ListEditor) Remove(start uint64, end uint64) *ListEditor
func (*ListEditor) RemoveAt ¶
func (le *ListEditor) RemoveAt(idx uint64) *ListEditor
func (*ListEditor) Set ¶
func (le *ListEditor) Set(idx uint64, v Valuable) *ListEditor
func (*ListEditor) Splice ¶
func (le *ListEditor) Splice(idx uint64, deleteCount uint64, vs ...Valuable) *ListEditor
type ListIterator ¶
type ListIterator struct {
// contains filtered or unexported fields
}
ListIterator can be used to efficiently iterate through a Noms List.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
var EmptyMap Map
func (Map) BufferedIterator ¶
func (m Map) BufferedIterator(ctx context.Context) (MapIterator, error)
func (Map) BufferedIteratorAt ¶
func (Map) Diff ¶
Diff computes the diff from |last| to |m| using the top-down algorithm, which completes as fast as possible while taking longer to return early results than left-to-right.
func (Map) DiffLeftRight ¶
DiffLeftRight computes the diff from |last| to |m| using a left-to-right streaming approach, optimised for returning results early, but not completing quickly.
func (Map) DiffLeftRightInRange ¶
func (m Map) DiffLeftRightInRange(ctx context.Context, last Map, start Value, inRange ValueInRange, changes chan<- ValueChanged) error
func (Map) Format ¶
func (m Map) Format() *NomsBinFormat
func (Map) HumanReadableString ¶
func (Map) IteratorAt ¶
func (Map) IteratorBackFrom ¶
func (Map) IteratorFrom ¶
func (Map) MaybeGetTuple ¶
func (Map) RangeIterator ¶
type MapEditor ¶
type MapEditor struct {
// contains filtered or unexported fields
}
MapEditor allows for efficient editing of Map-typed prolly trees.
func NewMapEditor ¶
func (*MapEditor) Format ¶
func (med *MapEditor) Format() *NomsBinFormat
func (*MapEditor) Remove ¶
func (med *MapEditor) Remove(k LesserValuable) *MapEditor
Remove adds an edit that will remove a value by key
type MapIterator ¶
type MapIterator interface { MapTupleIterator Next(ctx context.Context) (k, v Value, err error) }
MapIterator is the interface used by iterators over Noms Maps.
type MapTupleIterator ¶
MapTupleIterator is an iterator that returns map keys and values as types.Tuple instances and follow the standard go convention of using io.EOF to mean that all the data has been read.
type MarshalCallback ¶
type NomsBinFormat ¶
type NomsBinFormat struct {
// contains filtered or unexported fields
}
var Format_Default *NomsBinFormat
func GetFormatForVersionString ¶
func GetFormatForVersionString(s string) (*NomsBinFormat, error)
func (*NomsBinFormat) UsesFlatbuffers ¶
func (nbf *NomsBinFormat) UsesFlatbuffers() bool
func (*NomsBinFormat) VersionString ¶
func (nbf *NomsBinFormat) VersionString() string
type NomsKind ¶
type NomsKind uint8
NomsKind allows a TypeDesc to indicate what kind of type is described.
const ( BoolKind NomsKind = iota FloatKind StringKind BlobKind ValueKind ListKind MapKind RefKind SetKind // Keep StructKind and CycleKind together. StructKind CycleKind TypeKind UnionKind UUIDKind IntKind UintKind NullKind TupleKind InlineBlobKind TimestampKind DecimalKind JSONKind GeometryKind PointKind LinestringKind PolygonKind SerialMessageKind TupleRowStorageKind UnknownKind NomsKind = 255 )
All supported kinds of Noms types are enumerated here. The ordering of these (especially Bool, Float and String) is important for ordering of values.
type Null ¶
type Null byte
Int is a Noms Value wrapper around the primitive int32 type.
var NullValue Null
func (Null) HumanReadableString ¶
func (Null) Less ¶
func (v Null) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Path ¶
type Path []PathPart
A Path locates a value in Noms relative to some other value. For locating values absolutely within a database, see AbsolutePath. To locate values globally, see Spec.
For more details, see: https://github.com/attic-labs/noms/blob/master/doc/spelling.md.
func MustParsePath ¶
MustParsePath parses str into a Path, or panics if parsing failed.
type Point ¶
Point is a Noms Value wrapper around the primitive string type (for now).
func ParseEWKBPoint ¶
ParseEWKBPoint converts the data portion of a WKB point to Point Very similar logic to the function in GMS
func (Point) HumanReadableString ¶
func (Point) Less ¶
func (v Point) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Polygon ¶
type Polygon struct { SRID uint32 Lines []Linestring }
Polygon is a Noms Value wrapper around a string.
func ParseEWKBPoly ¶
ParseEWKBPoly converts the data portions of a WKB polygon to Polygon Very similar logic to the function in GMS
func (Polygon) HumanReadableString ¶
func (Polygon) Less ¶
func (v Polygon) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type PrimitiveDesc ¶
type PrimitiveDesc NomsKind
PrimitiveDesc implements TypeDesc for all primitive Noms types: Blob Bool Float String Type Value UUID Int Uint
func (PrimitiveDesc) Kind ¶
func (p PrimitiveDesc) Kind() NomsKind
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
func ToRefOfValue ¶
func ToRefOfValue(r Ref, nbf *NomsBinFormat) (Ref, error)
ToRefOfValue returns a new Ref that points to the same target as |r|, but with the type 'Ref<Value>'.
func (Ref) Compare ¶
func (v Ref) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
func (Ref) Format ¶
func (r Ref) Format() *NomsBinFormat
func (Ref) HumanReadableString ¶
func (Ref) IsZeroValue ¶
func (v Ref) IsZeroValue() bool
IsZeroValue can be used to test if a Value is the same as T{}.
func (Ref) Less ¶
func (v Ref) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
func (Ref) TargetHash ¶
func (Ref) TargetType ¶
func (Ref) TargetValue ¶
type RefCallback ¶
type SerialMessage ¶
type SerialMessage []byte
func (SerialMessage) Equals ¶
func (sm SerialMessage) Equals(other Value) bool
func (SerialMessage) Hash ¶
func (sm SerialMessage) Hash(nbf *NomsBinFormat) (hash.Hash, error)
func (SerialMessage) HumanReadableString ¶
func (sm SerialMessage) HumanReadableString() string
func (SerialMessage) Kind ¶
func (sm SerialMessage) Kind() NomsKind
func (SerialMessage) Less ¶
func (sm SerialMessage) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
var EmptySet Set
func (Set) Diff ¶
Diff computes the diff from |last| to |m| using the top-down algorithm, which completes as fast as possible while taking longer to return early results than left-to-right.
func (Set) DiffLeftRight ¶
DiffLeftRight computes the diff from |last| to |s| using a left-to-right streaming approach, optimised for returning results early, but not completing quickly.
func (Set) Format ¶
func (s Set) Format() *NomsBinFormat
func (Set) HumanReadableString ¶
func (Set) IteratorAt ¶
func (Set) IteratorFrom ¶
type SetEditor ¶
type SetEditor struct {
// contains filtered or unexported fields
}
SetEditor allows for efficient editing of Set-typed prolly trees. Edits are buffered to memory and can be applied via Build(), which returns a new Set. Prior to Build(), Get() & Has() will return the value that the resulting Set would return if it were built immediately prior to the respective call. Note: The implementation biases performance towards a usage which applies edits in key-order.
func NewSetEditor ¶
type SetIterator ¶
type SetIterator interface { // Next returns subsequent values from a set. It returns nil, when no objects remain. Next(ctx context.Context) (Value, error) // SkipTo(v) advances to and returns the next value in the iterator >= v. // Note: if the iterator has already returned the value being skipped to, it will return the next // value (just as if Next() was called). For example, given the following set: // s = Set{ 0, 3, 6, 9, 12, 15, 18 } // An iterator on the set would return: // i := s.Iterator() // i.Next() return 0 // i.SkipTo(4) -- returns 6 // i.skipTo(3) -- returns 9 (this is the next value in the iterator >= 3) // i.skipTo(12) -- returns 12 // i.skipTo(12) -- return 15 (this is the next value in the iterator >= 12) // i.skipTo(20) -- returns nil // If there are no values left in the iterator that are >= v, // the iterator will skip to the end of the sequence and return nil. SkipTo(ctx context.Context, v Value) (Value, error) }
SetIterator defines methods that can be used to efficiently iterate through a set in 'Noms-defined' sorted order.
func NewIntersectionIterator ¶
func NewIntersectionIterator(ctx context.Context, nbf *NomsBinFormat, iterA, iterB SetIterator) (SetIterator, error)
NewIntersectionIterator creates a intersect iterator from two other SetIterators.
func NewUnionIterator ¶
func NewUnionIterator(ctx context.Context, nbf *NomsBinFormat, iterA, iterB SetIterator) (SetIterator, error)
NewUnionIterator creates a union iterator from two other SetIterators.
type Splice ¶
Read a Splice as "at SpAt (in the previous state), SpRemoved elements were removed and SpAdded elements were inserted, which can be found starting at SpFrom in the current state"
type StreamingMap ¶
type StreamingMap struct {
// contains filtered or unexported fields
}
func NewStreamingMap ¶
func NewStreamingMap(ctx context.Context, vrw ValueReadWriter, kvs <-chan Value) *StreamingMap
NewStreamingMap takes an input channel of values and returns a value that will produce a finished Map when |.Wait()| is called. Values sent to the input channel must be alternating keys and values. (e.g. k1, v1, k2, v2...). Moreover keys need to be added to the channel in Noms sortorder, adding key values to the input channel out of order will result in an error. Once the input channel is closed by the caller, a finished Map will be available from the |Wait| call.
See graph_builder.go for building collections with values that are not in order.
func (*StreamingMap) Done ¶
func (sm *StreamingMap) Done() <-chan struct{}
Done returns a signal channel which is closed once the StreamingMap is no longer reading from the key/values channel. A send to the key/value channel should be in a select with a read from this channel to ensure that the send does not deadlock.
func (*StreamingMap) Wait ¶
func (sm *StreamingMap) Wait() (Map, error)
type String ¶
type String string
String is a Noms Value wrapper around the primitive string type.
func (String) HumanReadableString ¶
func (String) Less ¶
func (s String) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
func EmptyStruct ¶
func EmptyStruct(nbf *NomsBinFormat) Struct
func NewStruct ¶
func NewStruct(nbf *NomsBinFormat, name string, data StructData) (Struct, error)
func (Struct) Compare ¶
func (v Struct) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
func (Struct) Delete ¶
Delete returns a new struct where the field name has been removed. If name is not an existing field in the struct then the current struct is returned.
func (Struct) Format ¶
func (s Struct) Format() *NomsBinFormat
func (Struct) HumanReadableString ¶
func (Struct) IsZeroValue ¶
func (v Struct) IsZeroValue() bool
IsZeroValue can be used to test if a Value is the same as T{}.
func (Struct) IterFields ¶
IterFields iterates over the fields, calling cb for every field in the struct.
func (Struct) Less ¶
func (v Struct) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
func (Struct) MaybeGet ¶
MaybeGet returns the value of a field in the struct. If the struct does not a have a field with the name name then this returns (nil, false).
type StructData ¶
type StructDesc ¶
type StructDesc struct { Name string // contains filtered or unexported fields }
StructDesc describes a custom Noms Struct.
func (StructDesc) IterFields ¶
func (s StructDesc) IterFields(cb func(name string, t *Type, optional bool))
func (StructDesc) Kind ¶
func (s StructDesc) Kind() NomsKind
func (StructDesc) Len ¶
func (s StructDesc) Len() int
Len returns the number of fields in the struct
type StructField ¶
StructField describes a field in a struct type.
type StructTemplate ¶
type StructTemplate struct {
// contains filtered or unexported fields
}
StructTemplate allows creating a template for structs with a known shape (name and fields). If a lot of structs of the same shape are being created then using a StructTemplate makes that slightly more efficient.
func MakeStructTemplate ¶
func MakeStructTemplate(name string, fieldNames []string) (t StructTemplate)
MakeStructTemplate creates a new StructTemplate or panics if the name and fields are not valid.
func (StructTemplate) NewStruct ¶
func (st StructTemplate) NewStruct(nbf *NomsBinFormat, values []Value) (Struct, error)
NewStruct creates a new Struct from the StructTemplate. The order of the values must match the order of the field names of the StructTemplate.
type TargetAnnotation ¶
type TargetAnnotation struct { }
TargetAnnotation is a PathPart annotation to resolve to the targetValue of the Ref it is resolved on.
func (TargetAnnotation) Resolve ¶
func (ann TargetAnnotation) Resolve(ctx context.Context, v Value, vr ValueReader) (Value, error)
func (TargetAnnotation) String ¶
func (ann TargetAnnotation) String() string
type Timestamp ¶
func (Timestamp) HumanReadableString ¶
func (Timestamp) Less ¶
func (v Timestamp) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Tuple ¶
type Tuple struct {
// contains filtered or unexported fields
}
func EmptyTuple ¶
func EmptyTuple(nbf *NomsBinFormat) Tuple
func (Tuple) AsSlice ¶
func (t Tuple) AsSlice() (TupleValueSlice, error)
AsSlice returns all of the values of this Tuple as a slice.
func (Tuple) AsSubslice ¶
func (t Tuple) AsSubslice(n uint64) (TupleValueSlice, error)
AsSubslice returns the first n values of this Tuple as a slice.
func (Tuple) Compare ¶
func (t Tuple) Compare(nbf *NomsBinFormat, other LesserValuable) (int, error)
func (Tuple) CopyOf ¶
func (t Tuple) CopyOf(vrw ValueReadWriter) Tuple
CopyOf creates a copy of a tuple. This is necessary in cases where keeping a reference to the original tuple is preventing larger objects from being collected.
func (Tuple) Format ¶
func (t Tuple) Format() *NomsBinFormat
func (Tuple) Get ¶
Get returns the value of a field in the tuple. If the tuple does not a have a field at the index then this panics
func (Tuple) HumanReadableString ¶
func (Tuple) IsZeroValue ¶
func (v Tuple) IsZeroValue() bool
IsZeroValue can be used to test if a Value is the same as T{}.
func (Tuple) IterFields ¶
IterFields iterates over the fields, calling cb for every field in the tuple until cb returns false
func (Tuple) Iterator ¶
func (t Tuple) Iterator() (*TupleIterator, error)
func (Tuple) IteratorAt ¶
func (t Tuple) IteratorAt(pos uint64) (*TupleIterator, error)
func (Tuple) Less ¶
func (t Tuple) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
func (Tuple) PrefixEquals ¶
PrefixEquals returns whether the given Tuple and calling Tuple have equivalent values up to the given count. Useful for testing Tuple equality for partial keys. If the Tuples are not of the same length, and one Tuple's length is less than the given count, then this returns false. If the Tuples are of the same length and they're both less than the given count, then this function is equivalent to Equals.
func (Tuple) Set ¶
Set returns a new tuple where the field at index n is set to value. Attempting to use Set on an index that is outside of the bounds will cause a panic. Use Append to add additional values, not Set.
func (Tuple) StartsWith ¶
func (Tuple) TupleCompare ¶
func (t Tuple) TupleCompare(nbf *NomsBinFormat, otherTuple Tuple) (int, error)
func (Tuple) WalkValues ¶
func (t Tuple) WalkValues(ctx context.Context, cb ValueCallback) error
type TupleFactory ¶
type TupleFactory struct {
// contains filtered or unexported fields
}
TupleFactory provides a more memory efficient mechanism for creating many tuples
func NewTupleFactory ¶
func NewTupleFactory(approxCapacity int) *TupleFactory
NewTupleFactory creates a new tuple factory. The approxCapacity argument is used to calculate how large the buffer allocations should be. The factory keeps track of the largest tuple it has created, and when allocating it creates a buffer large enough to store <approxCapacity> tuples of that size.
func (*TupleFactory) Create ¶
func (tf *TupleFactory) Create(values ...Value) (Tuple, error)
Create creates a new Tuple using the TupleFactory
func (*TupleFactory) Reset ¶
func (tf *TupleFactory) Reset(nbf *NomsBinFormat)
Reset is called when a TupleFactory is reused as you might want when pooling these. Reset does not reset the buffer as the memory may be in use by tuples that have not been collected and reference the same memory. It also does not reset biggestTuple. It's ok for biggestTuple to grow as time goes on.
type TupleIterator ¶
type TupleIterator struct {
// contains filtered or unexported fields
}
func (*TupleIterator) CodecReader ¶
func (itr *TupleIterator) CodecReader() (CodecReader, uint64)
func (*TupleIterator) HasMore ¶
func (itr *TupleIterator) HasMore() bool
func (*TupleIterator) InitForTuple ¶
func (itr *TupleIterator) InitForTuple(t Tuple) error
func (*TupleIterator) InitForTupleAt ¶
func (itr *TupleIterator) InitForTupleAt(t Tuple, pos uint64) error
func (*TupleIterator) Len ¶
func (itr *TupleIterator) Len() uint64
func (*TupleIterator) NextUint64 ¶
func (itr *TupleIterator) NextUint64() (pos uint64, val uint64, err error)
func (*TupleIterator) Pos ¶
func (itr *TupleIterator) Pos() uint64
func (*TupleIterator) Skip ¶
func (itr *TupleIterator) Skip() error
type TupleReadCloser ¶
type TupleReadCloser interface { TupleReader Closer }
TupleReadCloser is an interface for a TupleReader that has a Close method
func NewTupleReader ¶
func NewTupleReader(nbf *NomsBinFormat, vrw ValueReadWriter, rd io.Reader) TupleReadCloser
NewTupleReader returns a TupleReadCloser that reads tuple data from the supplied io.Reader
type TupleReader ¶
type TupleReader interface { // Read reades the next tuple from the TupleReader Read() (*Tuple, error) }
TupleReader is an interface for an object that supports reading types.Tuples
type TupleReadingEditProvider ¶
type TupleReadingEditProvider struct {
// contains filtered or unexported fields
}
func (TupleReadingEditProvider) Close ¶
func (t TupleReadingEditProvider) Close(ctx context.Context) error
func (TupleReadingEditProvider) Next ¶
func (t TupleReadingEditProvider) Next() (*KVP, error)
func (TupleReadingEditProvider) ReachedEOF ¶
func (t TupleReadingEditProvider) ReachedEOF() bool
ReachedEOF returns true once all data is exhausted. If ReachedEOF returns false that does not mean that there is more data, only that io.EOF has not been returned previously. If ReachedEOF returns true then all edits have been read
type TupleRowStorage ¶
type TupleRowStorage []byte
TupleRowStorage is a clone of InlineBlob. It only exists to be able to easily differentiate these two very different use cases during the migration from the old storage format to the new one.
func (TupleRowStorage) Equals ¶
func (v TupleRowStorage) Equals(other Value) bool
func (TupleRowStorage) Hash ¶
func (v TupleRowStorage) Hash(nbf *NomsBinFormat) (hash.Hash, error)
func (TupleRowStorage) HumanReadableString ¶
func (v TupleRowStorage) HumanReadableString() string
func (TupleRowStorage) Kind ¶
func (v TupleRowStorage) Kind() NomsKind
func (TupleRowStorage) Less ¶
func (v TupleRowStorage) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type TupleSlice ¶
type TupleSlice []Tuple
func (TupleSlice) Contains ¶
func (vs TupleSlice) Contains(nbf *NomsBinFormat, v Tuple) bool
func (TupleSlice) Equals ¶
func (vs TupleSlice) Equals(other TupleSlice) bool
type TupleSort ¶
type TupleSort struct { Tuples []Tuple Nbf *NomsBinFormat }
type TupleValueSlice ¶
type TupleValueSlice []Value
func (TupleValueSlice) Kind ¶
func (tvs TupleValueSlice) Kind() NomsKind
func (TupleValueSlice) Less ¶
func (tvs TupleValueSlice) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type TupleWriteCloser ¶
type TupleWriteCloser interface { TupleWriter Closer }
TupleWriteCloser is an interface for a TupleWriter that has a Close method
func NewTupleWriter ¶
func NewTupleWriter(wr io.Writer) TupleWriteCloser
NewTupleWriter returns a TupleWriteCloser that writes tuple data to the supplied io.Writer
type TupleWriter ¶
type TupleWriter interface { // WriteTuples writes the provided tuples WriteTuples(...Tuple) error // WriteNull write a null to the stream WriteNull() error // CopyFrom reads tuples from a reader and writes them CopyFrom(TupleReader) error }
TupleWriter is an interface for an object that supports Types.Tuples being written to it
type Type ¶
type Type struct {
Desc TypeDesc
}
func MakeCycleType ¶
func MakeListType ¶
func MakeMapType ¶
func MakePrimitiveType ¶
func MakeRefType ¶
func MakeSetType ¶
func MakeStructType ¶
func MakeStructType(name string, fields ...StructField) (*Type, error)
func MakeUnionType ¶
MakeUnionType creates a new union type unless the elemTypes can be folded into a single non union type.
func TypeOf ¶
TypeOf returns the type describing the value. This is not an exact type but often a simplification of the concrete type.
func (*Type) HumanReadableString ¶
func (*Type) Less ¶
func (t *Type) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
func (*Type) TargetKind ¶
type TypeAnnotation ¶
type TypeAnnotation struct { }
TypeAnnotation is a PathPart annotation to resolve to the type of the value it's resolved in.
func (TypeAnnotation) Resolve ¶
func (ann TypeAnnotation) Resolve(ctx context.Context, v Value, vr ValueReader) (Value, error)
func (TypeAnnotation) String ¶
func (ann TypeAnnotation) String() string
type TypeDesc ¶
type TypeDesc interface { Kind() NomsKind // contains filtered or unexported methods }
TypeDesc describes a type of the kind returned by Kind(), e.g. Map, Float, or a custom type.
type UUID ¶
func UUIDHashedFromValues ¶
func UUIDHashedFromValues(nbf *NomsBinFormat, vals ...Value) (UUID, error)
UUIDHashedFromValues generates a UUID from the first 16 byes of the hash.Hash generated from serialized |vals|.
func (UUID) HumanReadableString ¶
func (UUID) Less ¶
func (v UUID) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type Uint ¶
type Uint uint64
Int is a Noms Value wrapper around the primitive int32 type.
func (Uint) HumanReadableString ¶
func (Uint) Less ¶
func (v Uint) Less(nbf *NomsBinFormat, other LesserValuable) (bool, error)
type UnionIterator ¶
type UnionIterator struct {
// contains filtered or unexported fields
}
UnionIterator combines the results from two other iterators. The values from Next() are returned in noms-defined order with all duplicates removed.
type ValidatingDecoder ¶
type ValidatingDecoder struct {
// contains filtered or unexported fields
}
func NewValidatingDecoder ¶
func NewValidatingDecoder(cs chunks.ChunkStore) *ValidatingDecoder
func (*ValidatingDecoder) Decode ¶
func (vbs *ValidatingDecoder) Decode(c *chunks.Chunk) (DecodedChunk, error)
Decode decodes c and checks that the hash of the resulting value matches c.Hash(). It returns a DecodedChunk holding both c and a pointer to the decoded Value.
type Valuable ¶
type Valuable interface { // Kind is the NomsKind describing the kind of value this is. Kind() NomsKind Value(ctx context.Context) (Value, error) }
Valuable is an interface from which a Value can be retrieved.
type Value ¶
type Value interface { LesserValuable // Equals determines if two different Noms values represents the same underlying value. Equals(other Value) bool // Hash is the hash of the value. All Noms values have a unique hash and if two values have the // same hash they must be equal. Hash(*NomsBinFormat) (hash.Hash, error) // HumanReadableString returns a human-readable string version of this Value (not meant for re-parsing) HumanReadableString() string // contains filtered or unexported methods }
Value is the interface all Noms values implement.
func DecodeValue ¶
func DecodeValue(c chunks.Chunk, vrw ValueReadWriter) (Value, error)
DecodeValue decodes a value from a chunk source. It is an error to provide an empty chunk.
func ParsePathIndex ¶
Parse a Noms value from the path index syntax. 4 -> types.Float "4" -> types.String true|false -> types.Boolean #<chars> -> hash.Hash
type ValueCallback ¶
type ValueChanged ¶
type ValueChanged struct { ChangeType DiffChangeType Key, OldValue, NewValue Value }
type ValueInRange ¶
type ValueReadWriter ¶
type ValueReadWriter interface { ValueReader ValueWriter }
ValueReadWriter is an interface that knows how to read and write Noms Values, e.g. datas/Database. Required to avoid import cycle between this package and the package that implements Value read/writing.
type ValueReader ¶
type ValueReader interface { Format() *NomsBinFormat ReadValue(ctx context.Context, h hash.Hash) (Value, error) ReadManyValues(ctx context.Context, hashes hash.HashSlice) (ValueSlice, error) }
ValueReader is an interface that knows how to read Noms Values, e.g. datas/Database. Required to avoid import cycle between this package and the package that implements Value reading.
type ValueSlice ¶
type ValueSlice []Value
func (ValueSlice) Contains ¶
func (vs ValueSlice) Contains(nbf *NomsBinFormat, val Value) bool
func (ValueSlice) Equals ¶
func (vs ValueSlice) Equals(other ValueSlice) bool
type ValueSort ¶
type ValueSort struct { Values []Value Nbf *NomsBinFormat }
type ValueStats ¶
type ValueStats interface {
String() string
}
type ValueStore ¶
type ValueStore struct {
// contains filtered or unexported fields
}
ValueStore provides methods to read and write Noms Values to a ChunkStore. It minimally validates Values as they're written, but does not guarantee that these Values are persisted through the ChunkStore until a subsequent Flush. Currently, WriteValue validates the following properties of a Value v: - v can be correctly serialized and its Ref taken
func NewMemoryValueStore ¶
func NewMemoryValueStore() *ValueStore
NewMemoryValueStore creates a simple struct that satisfies ValueReadWriter and is backed by a chunks.TestStore. Used for dolt operations outside of noms.
func NewValueStore ¶
func NewValueStore(cs chunks.ChunkStore) *ValueStore
NewValueStore returns a ValueStore instance that owns the provided ChunkStore and manages its lifetime. Calling Close on the returned ValueStore will Close() cs.
func (*ValueStore) ChunkStore ¶
func (lvs *ValueStore) ChunkStore() chunks.ChunkStore
func (*ValueStore) Close ¶
func (lvs *ValueStore) Close() error
Close closes the underlying ChunkStore
func (*ValueStore) Commit ¶
Commit flushes all bufferedChunks into the ChunkStore, with best-effort locality, and attempts to Commit, updating the root to |current| (or keeping it the same as Root()). If the root has moved since this ValueStore was opened, or last Rebased(), it will return false and will have internally rebased. Until Commit() succeeds, no work of the ValueStore will be visible to other readers of the underlying ChunkStore.
func (*ValueStore) Format ¶
func (lvs *ValueStore) Format() *NomsBinFormat
func (*ValueStore) GC ¶
GC traverses the ValueStore from the root and removes unreferenced chunks from the ChunkStore
func (*ValueStore) ReadManyValues ¶
func (lvs *ValueStore) ReadManyValues(ctx context.Context, hashes hash.HashSlice) (ValueSlice, error)
ReadManyValues reads and decodes Values indicated by |hashes| from lvs and returns the found Values in the same order. Any non-present Values will be represented by nil.
func (*ValueStore) ReadValue ¶
ReadValue reads and decodes a value from lvs. It is not considered an error for the requested chunk to be empty; in this case, the function simply returns nil.
func (*ValueStore) SetEnforceCompleteness ¶
func (lvs *ValueStore) SetEnforceCompleteness(enforce bool)
func (*ValueStore) WriteValue ¶
WriteValue takes a Value, schedules it to be written it to lvs, and returns an appropriately-typed types.Ref. v is not guaranteed to be actually written until after Flush().
Source Files ¶
- apply_map_edits.go
- blob.go
- blob_leaf_sequence.go
- bool.go
- buffered_sequence_iterator.go
- codec.go
- collection.go
- common_supertype.go
- decimal.go
- dumb_edit_accumulator.go
- edit_distance.go
- encode_human_readable.go
- float.go
- float_util.go
- format.go
- geometry.go
- get_hash.go
- indexed_sequence_diff.go
- indexed_sequences.go
- inlineblob.go
- int.go
- json.go
- kvp.go
- leaf_sequence.go
- less.go
- linestring.go
- list.go
- list_editor.go
- list_iterator.go
- list_leaf_sequence.go
- make_type.go
- map.go
- map_editor.go
- map_iterator.go
- map_leaf_sequence.go
- meta_sequence.go
- noms_kind.go
- null_value.go
- ordered_sequences.go
- ordered_sequences_diff.go
- parallel_ref_walker.go
- path.go
- point.go
- polygon.go
- ref.go
- rolling_value_hasher.go
- sequence.go
- sequence_chunker.go
- sequence_concat.go
- sequence_cursor.go
- serial_message.go
- set.go
- set_editor.go
- set_iterator.go
- set_leaf_sequence.go
- simplify.go
- sort.go
- string.go
- struct.go
- subtype.go
- timestamp.go
- tuple.go
- tuple_stream.go
- tuplerowstorage.go
- type.go
- type_desc.go
- uint.go
- uuid.go
- validate_type.go
- validating_decoder.go
- value.go
- value_decoder.go
- value_stats.go
- value_store.go
- walk_refs.go