func (d *dataStoreData) fixKeyLocked(ents *memCollection, key *ds.Key) (*ds.Key, error) { if key.Incomplete() { id, err := d.allocateIDsLocked(ents, key, 1) if err != nil { return key, err } key = ds.NewKey(key.AppID(), key.Namespace(), key.Kind(), "", id, key.Parent()) } return key, nil }
// PartialValid returns true iff this key is suitable for use in a Put // operation. This is the same as Valid(k, false, ...), but also allowing k to // be Incomplete(). func PartialValid(k ds.Key, aid, ns string) bool { if k.Incomplete() { k = New(k.AppID(), k.Namespace(), k.Kind(), "", 1, k.Parent()) } return Valid(k, false, aid, ns) }