notes

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	INDEX_ID_PATTERN        = regexp.MustCompile(`^id:\s*(.*)`)
	INDEX_TITLE_PATTERN     = regexp.MustCompile(`^title:\s*(.*)`)
	INDEX_PATH_PATTERN      = regexp.MustCompile(`^path:\s*(.*)`)
	INDEX_CREATEDON_PATTERN = regexp.MustCompile(`^created_on:\s*(.*)`)
)

Functions

func GetNoteContents

func GetNoteContents(entry *IndexEntry) ([]byte, error)

func GetNotesRoot

func GetNotesRoot() string

func NewNote

func NewNote(title string, index []*IndexEntry) (*IndexEntry, []*IndexEntry)

func SaveIndex

func SaveIndex(entries []*IndexEntry) error

func SetNoteContents

func SetNoteContents(content []byte, entry *IndexEntry) error

Types

type FieldSchema

type FieldSchema struct {
	Name       string
	Type       string
	IsOptional bool
}

type IndexEntry

type IndexEntry struct {
	ID        string
	Title     string
	Path      string
	CreatedOn time.Time
}

func DeleteNote

func DeleteNote(id string, index []*IndexEntry) ([]*IndexEntry, error)

func ImportNote

func ImportNote(srcPath string) (*IndexEntry, error)

func LoadIndex

func LoadIndex() ([]*IndexEntry, error)

func LookupNote

func LookupNote(id string, index []*IndexEntry) *IndexEntry

type ParserSchema

type ParserSchema struct {
	Fields      []*FieldSchema
	FieldFormat string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL