NoteInfo prints a note information
(w io.Writer, info database.NoteInfo)
| 28 | |
| 29 | // NoteInfo prints a note information |
| 30 | func 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 | |
| 44 | func NoteContent(w io.Writer, info database.NoteInfo) { |
| 45 | fmt.Fprintf(w, "%s", info.Content) |