newHash creates a hash object
(txn *Transaction, key []byte)
| 63 | |
| 64 | //newHash creates a hash object |
| 65 | func newHash(txn *Transaction, key []byte) *Hash { |
| 66 | now := Now() |
| 67 | return &Hash{ |
| 68 | txn: txn, |
| 69 | key: key, |
| 70 | meta: &HashMeta{ |
| 71 | Object: Object{ |
| 72 | ID: UUID(), |
| 73 | CreatedAt: now, |
| 74 | UpdatedAt: now, |
| 75 | ExpireAt: 0, |
| 76 | Type: ObjectHash, |
| 77 | Encoding: ObjectEncodingHT, |
| 78 | }, |
| 79 | }, |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | //hashItemKey spits field into metakey |
| 84 | func hashItemKey(key []byte, field []byte) []byte { |