MCPcopy Create free account
hub / github.com/distributedio/titan / Append

Method Append

db/string.go:100–106  ·  view source on GitHub ↗

Append appends a value to key

(value []byte)

Source from the content-addressed store, hash-verified

98
99// Append appends a value to key
100func (s *String) Append(value []byte) (int, error) {
101 s.Meta.Value = append(s.Meta.Value, value...)
102 if err := s.txn.t.Set(MetaKey(s.txn.db, s.key), s.encode()); err != nil {
103 return 0, err
104 }
105 return len(s.Meta.Value), nil
106}
107
108// GetSet returns old value ,value replace old value
109func (s *String) GetSet(value []byte) ([]byte, error) {

Callers 2

AppendFunction · 0.80
TestStringAppendFunction · 0.80

Calls 3

encodeMethod · 0.95
MetaKeyFunction · 0.85
SetMethod · 0.65

Tested by 1

TestStringAppendFunction · 0.64