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

Method Set

internal/utils/kvstore/table.go:73–90  ·  view source on GitHub ↗
(key string, value T)

Source from the content-addressed store, hash-verified

71}
72
73func (this *Table[T]) Set(key string, value T) error {
74 if this.isClosed {
75 return NewTableClosedErr(this.name)
76 }
77
78 if len(key) > KeyMaxLength {
79 return ErrKeyTooLong
80 }
81
82 valueBytes, err := this.encoder.Encode(value)
83 if err != nil {
84 return err
85 }
86
87 return this.WriteTx(func(tx *Tx[T]) error {
88 return this.set(tx, key, valueBytes, value, false, false)
89 })
90}
91
92func (this *Table[T]) SetSync(key string, value T) error {
93 if this.isClosed {

Callers 1

setMethod · 0.45

Calls 4

WriteTxMethod · 0.95
setMethod · 0.95
NewTableClosedErrFunction · 0.85
EncodeMethod · 0.65

Tested by

no test coverage detected