本文整理匯總了Golang中github.com/tetrafolium/gae/service/datastore.Key.Kind方法的典型用法代碼示例。如果您正苦於以下問題:Golang Key.Kind方法的具體用法?Golang Key.Kind怎麽用?Golang Key.Kind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/tetrafolium/gae/service/datastore.Key
的用法示例。
在下文中一共展示了Key.Kind方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: AllocateIDs
func (d rdsImpl) AllocateIDs(incomplete *ds.Key, n int) (start int64, err error) {
par, err := dsF2R(d.aeCtx, incomplete.Parent())
if err != nil {
return
}
start, _, err = datastore.AllocateIDs(d.aeCtx, incomplete.Kind(), par, n)
return
}
示例2: fixKeyLocked
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
}
示例3: allocateIDsLocked
func (d *dataStoreData) allocateIDsLocked(ents *memCollection, incomplete *ds.Key, n int) (int64, error) {
if d.disableSpecialEntities {
return 0, errors.New("disableSpecialEntities is true so allocateIDs is disabled")
}
idKey := []byte(nil)
if incomplete.Parent() == nil {
idKey = rootIDsKey(incomplete.Kind())
} else {
idKey = groupIDsKey(incomplete)
}
return incrementLocked(ents, idKey, n), nil
}
示例4: indexEntriesWithBuiltins
func indexEntriesWithBuiltins(k *ds.Key, pm ds.PropertyMap, complexIdxs []*ds.IndexDefinition) *memStore {
sip := serialize.PropertyMapPartially(k, pm)
return indexEntries(sip, k.Namespace(), append(defaultIndexes(k.Kind(), pm), complexIdxs...))
}