Documentation
¶
Index ¶
- Variables
- func CheckUpdate(ctx infra.DnoteCtx) error
- func GetBookUUID(ctx infra.DnoteCtx, label string) (string, error)
- func GetConfigPath(ctx infra.DnoteCtx) string
- func GetDnoteTmpContentPath(ctx infra.DnoteCtx) string
- func GetEditorInput(ctx infra.DnoteCtx, fpath string, content *string) error
- func InitFiles(ctx infra.DnoteCtx) error
- func InitSystem(ctx infra.DnoteCtx) error
- func LogAction(tx *sql.Tx, schema int, actionType, data string, timestamp int64) error
- func ReadConfig(ctx infra.DnoteCtx) (infra.Config, error)
- func SanitizeContent(s string) string
- func WriteConfig(ctx infra.DnoteCtx, config infra.Config) error
- type Book
- type Note
- type RunEFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ConfigFilename is the name of the config file ConfigFilename = "dnoterc" // TmpContentFilename is the name of the temporary file that holds editor input TmpContentFilename = "DNOTE_TMPCONTENT" )
Functions ¶
func CheckUpdate ¶ added in v0.4.2
CheckUpdate triggers update if needed
func GetBookUUID ¶ added in v0.4.5
GetBookUUID returns a uuid of a book given a label
func GetConfigPath ¶
GetConfigPath returns the path to the dnote config file
func GetDnoteTmpContentPath ¶
GetDnoteTmpContentPath returns the path to the temporary file containing content being added or edited
func GetEditorInput ¶
GetEditorInput gets the user input by launching a text editor and waiting for it to exit
func InitFiles ¶ added in v0.4.3
InitFiles creates, if necessary, the dnote directory and files inside
func InitSystem ¶ added in v0.4.9
InitSystem inserts system data if missing
func ReadConfig ¶
ReadConfig reads the config file
Types ¶
type Book ¶ added in v0.4.9
type Book struct {
UUID string `json:"uuid"`
Label string `json:"label"`
USN int `json:"usn"`
Notes []Note `json:"notes"`
Deleted bool `json:"deleted"`
Dirty bool `json:"dirty"`
}
Book holds a metadata and its notes
type Note ¶ added in v0.4.9
type Note struct {
UUID string `json:"uuid"`
BookUUID string `json:"book_uuid"`
Content string `json:"content"`
AddedOn int64 `json:"added_on"`
EditedOn int64 `json:"edited_on"`
USN int `json:"usn"`
Public bool `json:"public"`
Deleted bool `json:"deleted"`
Dirty bool `json:"dirty"`
}
Note represents a note
func NewNote ¶
func NewNote(uuid, bookUUID, content string, addedOn, editedOn int64, usn int, public, deleted, dirty bool) Note
NewNote constructs a note with the given data
Click to show internal directories.
Click to hide internal directories.