note

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func Search(data *data.Buffer, searchTerm string) (models.Note, error)

func SearchKeyTagsByPrefix

func SearchKeyTagsByPrefix(prefix string, data *data.Buffer) []string

Types

type ModifyOption

type ModifyOption func(*models.Note)

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) Get

func (r NotesRepository) Get(key string) (models.Note, 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 NewTagger

func NewTagger(data *data.Buffer) Tagger

func (Tagger) Exists

func (t Tagger) Exists(tag string) bool

func (Tagger) IsValid

func (t Tagger) IsValid(tag string) error

func (Tagger) IsValidAsNew

func (t Tagger) IsValidAsNew(tag string) error

func (Tagger) Like

func (t Tagger) Like(tag string) (string, error)

Jump to

Keyboard shortcuts

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