2019-11-25 17:07:04 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package state
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
"github.com/hashicorp/go-memdb"
|
|
|
|
)
|
|
|
|
|
2020-09-02 15:24:20 +00:00
|
|
|
func firstWithTxn(tx ReadTxn,
|
2019-11-25 17:07:04 +00:00
|
|
|
table, index, idxVal string, entMeta *structs.EnterpriseMeta) (interface{}, error) {
|
|
|
|
|
|
|
|
return tx.First(table, index, idxVal)
|
|
|
|
}
|
|
|
|
|
2020-09-02 15:24:20 +00:00
|
|
|
func firstWatchWithTxn(tx ReadTxn,
|
2019-11-25 17:07:04 +00:00
|
|
|
table, index, idxVal string, entMeta *structs.EnterpriseMeta) (<-chan struct{}, interface{}, error) {
|
|
|
|
|
|
|
|
return tx.FirstWatch(table, index, idxVal)
|
|
|
|
}
|
|
|
|
|
2020-09-02 15:24:20 +00:00
|
|
|
func firstWatchCompoundWithTxn(tx ReadTxn,
|
2019-12-10 02:26:41 +00:00
|
|
|
table, index string, _ *structs.EnterpriseMeta, idxVals ...interface{}) (<-chan struct{}, interface{}, error) {
|
|
|
|
return tx.FirstWatch(table, index, idxVals...)
|
|
|
|
}
|
|
|
|
|
2020-09-02 15:24:20 +00:00
|
|
|
func getWithTxn(tx ReadTxn,
|
2019-11-25 17:07:04 +00:00
|
|
|
table, index, idxVal string, entMeta *structs.EnterpriseMeta) (memdb.ResultIterator, error) {
|
|
|
|
|
|
|
|
return tx.Get(table, index, idxVal)
|
|
|
|
}
|
2019-12-10 02:26:41 +00:00
|
|
|
|
2020-09-02 15:24:20 +00:00
|
|
|
func getCompoundWithTxn(tx ReadTxn, table, index string,
|
2019-12-10 02:26:41 +00:00
|
|
|
_ *structs.EnterpriseMeta, idxVals ...interface{}) (memdb.ResultIterator, error) {
|
|
|
|
|
|
|
|
return tx.Get(table, index, idxVals...)
|
|
|
|
}
|