本文整理匯總了Golang中github.com/nexneo/samay/data.Project.Entries方法的典型用法代碼示例。如果您正苦於以下問題:Golang Project.Entries方法的具體用法?Golang Project.Entries怎麽用?Golang Project.Entries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/nexneo/samay/data.Project
的用法示例。
在下文中一共展示了Project.Entries方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: showProject
func showProject(project *data.Project) (err error) {
fmt.Printf(" id : %s\n", project.GetShaFromName())
fmt.Printf(" name : %s\n", project.GetName())
fmt.Printf(" entries : %d\n", len(project.Entries()))
fmt.Printf(" location : %s\n", project.Location())
return nil
}
示例2: deleteEntry
func deleteEntry(project *data.Project) (err error) {
for i, entry := range project.Entries() {
if i == theIdx {
return data.Destroy(entry)
}
}
return
}
示例3: moveEntry
func moveEntry(project, newProject *data.Project) error {
for i, entry := range project.Entries() {
if i == theIdx {
entry.Project = newProject
return data.Save(entry)
}
}
return nil
}
示例4: moveProject
func moveProject(project, newProject *data.Project) error {
for _, entry := range project.Entries() {
entry.Project = newProject
if err := data.Save(entry); err != nil {
return err
}
}
fmt.Printf("All entries copied to project \"%s\" \n...\n", newProject.GetName())
return deleteProject(project)
}
示例5: showEntry
func showEntry(project *data.Project) (err error) {
var started, ended *time.Time
for i, entry := range project.Entries() {
if i == theIdx {
started, err = entry.StartedTime()
ended, err = entry.EndedTime()
fmt.Printf(" id : %s\n", entry.GetId())
fmt.Printf(" contents : %s\n", entry.GetContent())
fmt.Printf(" duration : %s\n", strings.Trim(entry.HoursMins().String(), " "))
fmt.Printf(" started : %s\n", started)
fmt.Printf(" ended : %s\n", ended)
fmt.Printf(" tags : %v\n", entry.GetTags())
fmt.Printf(" billable : %t\n", entry.GetBillable())
break
}
}
return err
}