MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Exist

Method Exist

internal/utils/kvstore/table.go:144–161  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

142}
143
144func (this *Table[T]) Exist(key string) (found bool, err error) {
145 if this.isClosed {
146 return false, NewTableClosedErr(this.name)
147 }
148
149 _, closer, err := this.db.store.rawDB.Get(this.FullKey(key))
150 if err != nil {
151 if IsNotFound(err) {
152 return false, nil
153 }
154 return false, err
155 }
156 defer func() {
157 _ = closer.Close()
158 }()
159
160 return true, nil
161}
162
163func (this *Table[T]) Get(key string) (value T, err error) {
164 if this.isClosed {

Callers

nothing calls this directly

Calls 5

FullKeyMethod · 0.95
NewTableClosedErrFunction · 0.85
IsNotFoundFunction · 0.70
CloseMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected