Documentation ¶
Index ¶
- Variables
- func Search(data *data.Buffer, searchTerm string) (models.Note, error)
- func SearchKeyTagsByPrefix(prefix string, data *data.Buffer) []string
- type ModifyOption
- type NotesRepository
- func (r NotesRepository) AllKeys() []string
- func (r NotesRepository) Delete(key string) error
- func (r NotesRepository) Get(key string) (models.Note, error)
- func (r NotesRepository) LastAccessed() (models.Note, error)
- func (r NotesRepository) New(content string, modifiers ...ModifyOption) (string, error)
- func (r NotesRepository) Slice() []models.Note
- func (r NotesRepository) TagExists(tag string) bool
- func (r NotesRepository) Update(key string, modifiers ...ModifyOption) error
- type Tagger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTagAlreadyExists = errors.New("tag already exists") ErrTagNotProvided = errors.New("tag not provided") ErrTagNotFound = errors.New("tag not found") ErrTagInvalid = errors.New("tag invalid") )
View Source
var ErrNoteNotFound = errors.New("note not found")
Functions ¶
Types ¶
type ModifyOption ¶
func WithContent ¶
func WithContent(content string) ModifyOption
func WithKey ¶
func WithKey(key string) ModifyOption
func WithSpentTime ¶
func WithSpentTime(duration time.Duration) ModifyOption
func WithTag ¶
func WithTag(tag string) ModifyOption
type NotesRepository ¶
type NotesRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(data *data.Buffer) NotesRepository
func (NotesRepository) AllKeys ¶
func (r NotesRepository) AllKeys() []string
func (NotesRepository) Delete ¶
func (r NotesRepository) Delete(key string) error
func (NotesRepository) LastAccessed ¶
func (r NotesRepository) LastAccessed() (models.Note, error)
func (NotesRepository) New ¶
func (r NotesRepository) New(content string, modifiers ...ModifyOption) (string, error)
func (NotesRepository) Slice ¶
func (r NotesRepository) Slice() []models.Note
func (NotesRepository) TagExists ¶
func (r NotesRepository) TagExists(tag string) bool
func (NotesRepository) Update ¶
func (r NotesRepository) Update(key string, modifiers ...ModifyOption) error
type Tagger ¶
type Tagger struct {
// contains filtered or unexported fields
}
func (Tagger) IsValidAsNew ¶
Click to show internal directories.
Click to hide internal directories.