本文整理匯總了Golang中github.com/google/cayley/graph.NewSequentialKey函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewSequentialKey函數的具體用法?Golang NewSequentialKey怎麽用?Golang NewSequentialKey使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewSequentialKey函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Horizon
func (qs *QuadStore) Horizon() graph.PrimaryKey {
var horizon int64
err := qs.db.QueryRow("SELECT horizon FROM quads ORDER BY horizon DESC LIMIT 1;").Scan(&horizon)
if err != nil {
glog.Errorf("Couldn't execute horizon: %v", err)
return graph.NewSequentialKey(0)
}
return graph.NewSequentialKey(horizon)
}
示例2: Horizon
func (qs *QuadStore) Horizon() graph.PrimaryKey {
var log MongoLogEntry
err := qs.db.C("log").Find(nil).Sort("-LogID").One(&log)
if err != nil {
if err == mgo.ErrNotFound {
return graph.NewSequentialKey(0)
}
glog.Errorf("Could not get Horizon from Mongo: %v", err)
}
return graph.NewSequentialKey(log.LogID)
}
示例3: Horizon
func (qs *store) Horizon() graph.PrimaryKey { return graph.NewSequentialKey(0) }
示例4: Horizon
func (qs *QuadStore) Horizon() graph.PrimaryKey {
return graph.NewSequentialKey(qs.log[len(qs.log)-1].ID)
}
示例5: Horizon
func (qs *QuadStore) Horizon() graph.PrimaryKey {
return graph.NewSequentialKey(qs.horizon)
}