NewString create new string object
(txn *Transaction, key []byte)
| 44 | |
| 45 | // NewString create new string object |
| 46 | func 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 |
| 59 | func (s *String) Get() ([]byte, error) { |