Versions in this module Expand all Collapse all v1 v1.6.4 Oct 20, 2024 Changes in this version + var Version = "1.6.2" + type Categories map[string]*Category + func CollectCategories(cfg *Config, mode CategoryCollectMode) (Categories, error) + func (cats Categories) Names() []string + func (cats Categories) Notes(cfg *Config) ([]*Note, error) + type CategoriesCmd struct + Config *Config + Out io.Writer + func (cmd *CategoriesCmd) Do() error + type Category struct + Name string + NotePaths []string + Path string + func (cat *Category) Notes(c *Config) ([]*Note, error) + type CategoryCollectMode uint + const OnlyFirstCategory + type Cmd interface + Do func() error + func ParseCmd(args []string) (Cmd, error) + type Config struct + EditorCmd string + GitPath string + HomePath string + PagerCmd string + func NewConfig() (*Config, error) + type ConfigCmd struct + Config *Config + Name string + Out io.Writer + func (cmd *ConfigCmd) Do() error + type ExternalCmd struct + Args []string + ExePath string + NotesPath string + func NewExternalCmd(fromErr error, args []string) (*ExternalCmd, bool) + func (cmd *ExternalCmd) Do() error + type Git struct + func NewGit(c *Config) *Git + func (git *Git) AddAll() error + func (git *Git) Command(subcmd string, args ...string) *exec.Cmd + func (git *Git) Commit(msg string) error + func (git *Git) Exec(subcmd string, args ...string) (string, error) + func (git *Git) Init() error + func (git *Git) Push(remote, branch string) error + func (git *Git) TrackingRemote() (string, string, error) + type ListCmd struct + Category string + Config *Config + Edit bool + Full bool + Oneline bool + Out io.Writer + Relative bool + SortBy string + Tag string + func (cmd *ListCmd) Do() error + type MismatchCategoryError struct + func (e *MismatchCategoryError) Error() string + func (e *MismatchCategoryError) Is(target error) bool + type NewCmd struct + Category string + Config *Config + Filename string + NoEdit bool + NoInline bool + Tags string + func (cmd *NewCmd) Do() error + type Note struct + Category string + Config *Config + Created time.Time + File string + Tags []string + Title string + func LoadNote(path string, cfg *Config) (*Note, error) + func NewNote(cat, tags, file, title string, cfg *Config) (*Note, error) + func (note *Note) Create() error + func (note *Note) DirPath() string + func (note *Note) FilePath() string + func (note *Note) Open() error + func (note *Note) ReadBodyLines(maxLines int) (string, int, error) + func (note *Note) RelFilePath() string + func (note *Note) TemplatePath() (string, bool) + type PagerWriter struct + Cmdline string + Err error + func StartPagerWriter(pagerCmd string, stdout io.Writer) (*PagerWriter, error) + func (pager *PagerWriter) Wait() error + func (pager *PagerWriter) Write(p []byte) (int, error) + type SaveCmd struct + Config *Config + Message string + func (cmd *SaveCmd) Do() error + type SelfupdateCmd struct + Dry bool + Out io.Writer + Slug string + func (cmd *SelfupdateCmd) Do() error + type TagsCmd struct + Category string + Config *Config + Out io.Writer + func (cmd *TagsCmd) Do() error