Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/hashicorp/go-memdb
/ functions
Functions
188 in github.com/hashicorp/go-memdb
⨍
Functions
188
◇
Types & classes
37
↓ 105 callers
Method
Insert
Insert is used to add or update an object into the given table. When updating an object, the obj provided should be a copy rather than a value update
txn.go:183
↓ 80 callers
Method
Txn
Txn is used to start a new transaction in either read or write mode. There can only be a single concurrent writer, but any number of readers.
memdb.go:74
↓ 70 callers
Method
Next
Next returns the next result from the iterator. If there are no more results nil is returned.
txn.go:729
↓ 61 callers
Method
First
First is used to return the first matching object for the given constraints on the index. Note that all values read in the transaction form a consist
txn.go:605
↓ 36 callers
Method
Commit
Commit is used to finalize this transaction. This is a noop for read transactions, already aborted or committed transactions.
txn.go:133
↓ 30 callers
Method
Get
Get is used to construct a ResultIterator over all the rows that match the given constraints of an index. The index values must match exactly (this is
txn.go:744
↓ 27 callers
Function
noErr
(t *testing.T, err error)
integ_test.go:412
↓ 27 callers
Function
testObj
()
index_test.go:50
↓ 25 callers
Function
testDB
(t *testing.T)
txn_test.go:13
↓ 16 callers
Method
FromObject
FromObject extracts index values from an object. The return values are the same as a SingleIndexer except there can be multiple index values.
index.go:48
↓ 15 callers
Method
Abort
Abort is used to cancel this transaction. This is a noop for read transactions, already aborted or commited transactions.
txn.go:110
↓ 15 callers
Method
Delete
Delete is used to delete a single object from the given table. This object must already exist in the table.
txn.go:307
↓ 11 callers
Method
Watch
Watch blocks until one of the channels in the watch set is closed, or timeoutCh sends a value. Returns true if timeoutCh is what caused Watch to unblo
watch.go:52
↓ 10 callers
Method
Add
Add appends a watchCh to the WatchSet if non-nil.
watch.go:21
↓ 10 callers
Method
LongestPrefix
LongestPrefix is used to fetch the longest prefix match for the given constraints on the index. Note that this will not work with the memdb StringFiel
txn.go:630
↓ 10 callers
Function
NewMemDB
NewMemDB creates a new MemDB with the given schema.
memdb.go:39
↓ 10 callers
Function
NewWatchSet
NewWatchSet constructs a new watch set.
watch.go:16
↓ 10 callers
Function
compareEncoded
(t *testing.T, indexer Indexer, l interface{}, r interface{}, expected int)
index_test.go:978
↓ 10 callers
Method
parseString
parseString parses a UUID from the string. If enforceLength is false, it will parse a partial UUID. An error is returned if the input, stripped of hyp
index.go:573
↓ 9 callers
Method
Next
Next returns the next non-filtered result from the wrapped iterator.
filter.go:35
↓ 8 callers
Method
FromArgs
FromArgs is called to build the exact index key from a list of arguments.
index.go:24
↓ 8 callers
Method
FromArgs
(args ...interface{})
index.go:319
↓ 8 callers
Method
FromArgs
(args ...interface{})
index.go:415
↓ 8 callers
Function
generateUUID
()
index_test.go:597
↓ 7 callers
Method
AddWithLimit
AddWithLimit appends a watchCh to the WatchSet if non-nil, and if the given softLimit hasn't been exceeded. Otherwise, it will watch the given alterna
watch.go:40
↓ 7 callers
Method
DeleteAll
DeleteAll is used to delete all the objects in a given table matching the constraints on the index
txn.go:486
↓ 7 callers
Function
assertNilError
(t *testing.T, err error)
txn_test.go:2228
↓ 7 callers
Method
writableIndex
writableIndex returns a transaction usable for modifying the given index in a table.
txn.go:80
↓ 6 callers
Method
FromArgs
(args ...interface{})
index.go:97
↓ 6 callers
Method
FromArgs
(args ...interface{})
index.go:171
↓ 6 callers
Method
FromObject
(obj interface{})
index.go:66
↓ 6 callers
Method
Snapshot
Snapshot is used to capture a point-in-time snapshot of the database that will not be affected by any write operations to the existing DB. If MemDB
memdb.go:92
↓ 5 callers
Method
FromArgs
(args ...interface{})
index.go:537
↓ 5 callers
Method
FromObject
(obj interface{})
index.go:609
↓ 5 callers
Method
GetReverse
GetReverse is used to construct a Reverse ResultIterator over all the rows that match the given constraints of an index. The returned ResultIterator's
txn.go:769
↓ 5 callers
Method
PrefixFromArgs
(args ...interface{})
index.go:555
↓ 5 callers
Method
Validate
Validate validates the schema.
schema.go:19
↓ 5 callers
Method
getIndexValue
getIndexValue is used to get the IndexSchema and the value used to scan the index given the parameters. This handles prefix based scans when the index
txn.go:660
↓ 5 callers
Function
indexPath
indexPath returns the path from the root to the given table index
memdb.go:117
↓ 5 callers
Method
readableIndex
readableIndex returns a transaction usable for reading the given index in a table. If the transaction is a write transaction with modifications, a clo
txn.go:61
↓ 5 callers
Function
testValidSchema
()
schema_test.go:8
↓ 4 callers
Method
Defer
Defer is used to push a new arbitrary function onto a stack which gets called when a transaction is committed and finished. Deferred functions are cal
txn.go:962
↓ 4 callers
Method
FromArgs
WARNING: Because of a bug in FromObject, this function will never return a value when using the single-argument version.
index.go:260
↓ 4 callers
Method
FromArgs
(args ...interface{})
index.go:506
↓ 4 callers
Method
FromArgs
(args ...interface{})
index.go:626
↓ 4 callers
Method
FromArgs
(args ...interface{})
index.go:655
↓ 4 callers
Method
FromObject
(obj interface{})
index.go:135
↓ 4 callers
Method
FromObject
(obj interface{})
index.go:481
↓ 4 callers
Method
Last
Last is used to return the last matching object for the given constraints on the index. Note that all values read in the transaction form a consisten
txn.go:615
↓ 4 callers
Method
PrefixFromArgs
(args ...interface{})
index.go:728
↓ 4 callers
Method
Validate
()
schema.go:103
↓ 4 callers
Method
WatchCtx
WatchCtx blocks until one of the channels in the watch set is closed, or ctx is done (cancelled or exceeds the deadline). WatchCtx returns an error if
watch.go:77
↓ 3 callers
Method
Changes
Changes returns the set of object changes that have been made in the transaction so far. If change tracking is not enabled it wil always return nil. I
txn.go:869
↓ 3 callers
Method
FirstWatch
FirstWatch is used to return the first matching object for the given constraints on the index along with the watch channel. Note that all values read
txn.go:534
↓ 3 callers
Method
FromArgs
(args ...interface{})
index.go:713
↓ 3 callers
Method
FromObject
(obj interface{})
index.go:518
↓ 3 callers
Method
FromObject
(obj interface{})
index.go:641
↓ 3 callers
Method
FromObject
(raw interface{})
index.go:690
↓ 3 callers
Function
NewFilterIterator
NewFilterIterator wraps a ResultIterator. The filter function is applied to each value returned by a call to iter.Next. See the documentation for Res
filter.go:24
↓ 3 callers
Method
PrefixFromArgs
(args ...interface{})
index.go:113
↓ 3 callers
Method
PrefixFromArgs
(args ...interface{})
index.go:187
↓ 3 callers
Method
Snapshot
Snapshot creates a snapshot of the current state of the transaction. Returns a new read-only transaction or nil if the transaction is already aborted
txn.go:1006
↓ 3 callers
Method
Validate
Validate is used to validate the table schema
schema.go:53
↓ 3 callers
Function
fromBoolArgs
fromBoolArgs is a helper that expects only a single boolean argument and returns a single length byte array containing either a one or zero depending
index.go:662
↓ 3 callers
Method
getRoot
getRoot is used to do an atomic load of the root pointer
memdb.go:67
↓ 3 callers
Function
testPerson
()
integ_test.go:546
↓ 3 callers
Function
testPlace
()
integ_test.go:558
↓ 2 callers
Method
DeletePrefix
DeletePrefix is used to delete an entire subtree based on a prefix. The given index must be a prefix index, and will be used to perform a scan and enu
txn.go:384
↓ 2 callers
Method
FromObject
(obj interface{})
index.go:220
↓ 2 callers
Method
FromObject
(raw interface{})
index.go:795
↓ 2 callers
Function
IsIntType
IsIntType returns whether the passed type is a type of int and the number of bytes needed to encode the type.
index.go:368
↓ 2 callers
Function
IsUintType
IsUintType returns whether the passed type is a type of uint and the number of bytes needed to encode the type.
index.go:458
↓ 2 callers
Method
PrefixFromArgs
PrefixFromArgs is the same as FromArgs for an Indexer except that the index value returned should return all prefix-matched values.
index.go:56
↓ 2 callers
Method
WatchCh
()
txn.go:726
↓ 2 callers
Function
encodeInt
(val int64, size int)
index.go:341
↓ 2 callers
Function
encodeUInt
(val uint64, size int)
index.go:437
↓ 2 callers
Method
getIndexIterator
(table, index string, args ...interface{})
txn.go:926
↓ 2 callers
Method
getIndexIteratorReverse
(table, index string, args ...interface{})
txn.go:942
↓ 2 callers
Function
testComplexDB
(t *testing.T)
integ_test.go:538
↓ 2 callers
Function
testPopulateData
(t *testing.T, db *MemDB)
integ_test.go:357
↓ 2 callers
Function
testWatch
testWatch makes a bunch of watch channels based on the given size and fires the one at the given fire index to make sure it's detected (or a timeout o
watch_test.go:20
↓ 2 callers
Function
testWatchCh
(size, fire int)
watch_test.go:115
↓ 2 callers
Function
verifyNoResults
(t *testing.T, txn *Txn, table string, index string, value string)
txn_test.go:1013
↓ 2 callers
Function
watchFew
watchFew is used if there are only a few watchers as a performance optimization.
watch_few.go:18
↓ 1 callers
Method
FromObject
(obj interface{})
index.go:295
↓ 1 callers
Method
FromObject
(obj interface{})
index.go:391
↓ 1 callers
Method
LastWatch
LastWatch is used to return the last matching object for the given constraints on the index along with the watch channel. Note that all values read i
txn.go:574
↓ 1 callers
Method
LowerBound
LowerBound is used to construct a ResultIterator over all the the range of rows that have an index value greater than or equal to the provide args. Ca
txn.go:799
↓ 1 callers
Method
ReverseLowerBound
ReverseLowerBound is used to construct a Reverse ResultIterator over all the the range of rows that have an index value less than or equal to the prov
txn.go:825
↓ 1 callers
Function
String
(s string)
index_test.go:46
↓ 1 callers
Method
TrackChanges
TrackChanges enables change tracking for the transaction. If called at any point before commit, subsequent mutations will be recorded and can be retri
txn.go:52
↓ 1 callers
Method
WatchCh
WatchCh returns a channel that is used to wait for any channel of the watch set to trigger or for the context to be cancelled. WatchCh creates a new g
watch.go:145
↓ 1 callers
Function
assertAllUnique
(t *testing.T, vals [][]byte)
index_test.go:1431
↓ 1 callers
Function
indexerFromFieldNameList
(keys []string)
index_test.go:1445
↓ 1 callers
Method
initialize
initialize is used to setup the DB for use after creation. This should be called only once after allocating a MemDB.
memdb.go:103
↓ 1 callers
Function
render
render prints the template to stdout.
watch-gen/main.go:50
↓ 1 callers
Function
testComplexSchema
()
integ_test.go:440
↓ 1 callers
Method
watchMany
watchMany is used if there are many watchers.
watch.go:96
Function
BenchmarkCompoundMultiIndex_FromObject
(b *testing.B)
index_test.go:1457
Function
BenchmarkUUIDFieldIndex_parseString
(b *testing.B)
index_test.go:586
next →
1–100 of 188, ranked by callers