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

Function NewString

db/string.go:46–56  ·  view source on GitHub ↗

NewString create new string object

(txn *Transaction, key []byte)

Source from the content-addressed store, hash-verified

44
45// NewString create new string object
46func NewString(txn *Transaction, key []byte) *String {
47 str := &String{txn: txn, key: key}
48 now := Now()
49 str.Meta.CreatedAt = now
50 str.Meta.UpdatedAt = now
51 str.Meta.ExpireAt = 0
52 str.Meta.ID = UUID()
53 str.Meta.Type = ObjectString
54 str.Meta.Encoding = ObjectEncodingRaw
55 return str
56}
57
58// Get the value information for the key from db
59func (s *String) Get() ([]byte, error) {

Callers 7

SetFunction · 0.92
SetExFunction · 0.92
PSetExFunction · 0.92
TestGetStringFunction · 0.85
GetStringFunction · 0.85
StringsMethod · 0.85
SetValFunction · 0.85

Calls 2

NowFunction · 0.85
UUIDFunction · 0.85

Tested by 2

TestGetStringFunction · 0.68
SetValFunction · 0.68