本文整理汇总了Golang中github.com/angdev/chocolat/model.Project.RepoName方法的典型用法代码示例。如果您正苦于以下问题:Golang Project.RepoName方法的具体用法?Golang Project.RepoName怎么用?Golang Project.RepoName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/angdev/chocolat/model.Project
的用法示例。
在下文中一共展示了Project.RepoName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createMultipleEvents
func createMultipleEvents(p *model.Project, params CreateMultipleEventParams) (interface{}, error) {
r := repo.NewRepository(p.RepoName())
defer r.Close()
result := make(map[string][]RawResult)
for event, docs := range params {
result[event] = insertEvents(r, event, docs...)
}
return result, nil
}
示例2: createEvent
func createEvent(p *model.Project, collName string, params CreateSingleEventParams) (interface{}, error) {
r := repo.NewRepository(p.RepoName())
defer r.Close()
result := insertEvents(r, collName, params)
if result[0]["success"] == true {
return RawResult{"created": true}, nil
} else {
return RawResult{"created": false}, nil
}
}
示例3: inspectCollection
func inspectCollection(p *model.Project, name string) (interface{}, error) {
r := repo.NewRepository(p.RepoName())
defer r.Close()
c := r.C(name)
var result query.RawExpr
if err := c.Find(nil).One(&result); err != nil {
return nil, err
} else {
return inspectResult{
Name: name,
Properties: docToSchema(&result),
Url: fmt.Sprintf("/3.0/projects/<PROJECT_ID>/events/%s", name),
}, nil
}
}
示例4: inspectAllCollections
func inspectAllCollections(p *model.Project) (interface{}, error) {
r := repo.NewRepository(p.RepoName())
defer r.Close()
collectionNames, err := r.CollectionNames()
if err != nil {
return nil, err
}
results := []interface{}{}
for _, name := range collectionNames {
if singleResult, err := inspectCollection(p, name); err != nil {
return nil, err
} else {
results = append(results, singleResult)
}
}
return results, nil
}