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 LogAction(tx *sql.Tx, schema int, actionType, data string, timestamp int64) error
- func LogActionAddBook(tx *sql.Tx, name string) error
- func LogActionAddNote(tx *sql.Tx, noteUUID, bookName, content string, timestamp int64) error
- func LogActionEditNote(tx *sql.Tx, noteUUID, bookName, content string, ts int64) error
- func LogActionRemoveBook(tx *sql.Tx, name string) error
- func LogActionRemoveNote(tx *sql.Tx, noteUUID, bookName string) error
- func ReadConfig(ctx infra.DnoteCtx) (infra.Config, error)
- func Reduce(ctx infra.DnoteCtx, tx *sql.Tx, action actions.Action) error
- func ReduceAll(ctx infra.DnoteCtx, tx *sql.Tx, actionSlice []actions.Action) error
- func SanitizeContent(s string) string
- func WriteConfig(ctx infra.DnoteCtx, config infra.Config) error
- type RunEFunc
Constants ¶
This section is empty.
Variables ¶
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 LogActionAddBook ¶
LogActionAddBook logs an action for adding a book
func LogActionAddNote ¶
LogActionAddNote logs an action for adding a note
func LogActionEditNote ¶
LogActionEditNote logs an action for editing a note
func LogActionRemoveBook ¶
LogActionRemoveBook logs an action for removing book
func LogActionRemoveNote ¶
LogActionRemoveNote logs an action for removing a book
func ReadConfig ¶
ReadConfig reads the config file
func Reduce ¶
Reduce transitions the local dnote state by consuming the action returned from the server