MCPcopy Index your code
hub / github.com/dnote/dnote / NoteInfo

Function NoteInfo

pkg/cli/output/output.go:30–42  ·  view source on GitHub ↗

NoteInfo prints a note information

(w io.Writer, info database.NoteInfo)

Source from the content-addressed store, hash-verified

28
29// NoteInfo prints a note information
30func NoteInfo(w io.Writer, info database.NoteInfo) {
31 log.Infof("book name: %s\n", info.BookLabel)
32 log.Infof("created at: %s\n", time.Unix(0, info.AddedOn).Format("Jan 2, 2006 3:04pm (MST)"))
33 if info.EditedOn != 0 {
34 log.Infof("updated at: %s\n", time.Unix(0, info.EditedOn).Format("Jan 2, 2006 3:04pm (MST)"))
35 }
36 log.Infof("note id: %d\n", info.RowID)
37 log.Infof("note uuid: %s\n", info.UUID)
38
39 fmt.Fprintf(w, "\n------------------------content------------------------\n")
40 fmt.Fprintf(w, "%s", info.Content)
41 fmt.Fprintf(w, "\n-------------------------------------------------------\n")
42}
43
44func NoteContent(w io.Writer, info database.NoteInfo) {
45 fmt.Fprintf(w, "%s", info.Content)

Callers 4

viewNoteFunction · 0.92
runNoteFunction · 0.92
newRunFunction · 0.92
runNoteFunction · 0.92

Calls 1

InfofFunction · 0.92

Tested by

no test coverage detected