yaml

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name string
}

Config is a struct that represents YAML storage config

type Note

type Note struct {
	ID          string   `yaml:"id"`
	Tags        []string `yaml:"tags"`
	Command     string   `yaml:"command"`
	Description string   `yaml:"description"`
}

Note is a struct that represents a note in YAML storage

type Yaml

type Yaml struct {
	File  *os.File
	Notes []Note
}

Yaml is a struct that represents YAML storage

func Initialize

func Initialize(config *Config) *Yaml

Initialize the YAML storage

func (*Yaml) Delete

func (y *Yaml) Delete(id string) error

Delete deletes a note by id

func (*Yaml) DeleteByTags

func (y *Yaml) DeleteByTags(tags []string) error

DeleteByTags deletes notes by tags

func (*Yaml) Get

func (y *Yaml) Get(id string) (interface{}, error)

Get returns a note by id

func (*Yaml) GetAll

func (y *Yaml) GetAll() (interface{}, error)

GetAll returns all notes

func (*Yaml) GetByTags

func (y *Yaml) GetByTags(tags []string) (interface{}, error)

GetByTags returns notes by tags

func (*Yaml) GetTags

func (y *Yaml) GetTags() ([]string, error)

GetTags returns all available tags

func (*Yaml) Insert

func (y *Yaml) Insert(note interface{}) error

Insert inserts a new note to YAML storage

func (*Yaml) Search

func (y *Yaml) Search(searchWords []string, searchLocations []string) (interface{}, error)

Search returns notes by search words

func (*Yaml) SearchInCommand

func (y *Yaml) SearchInCommand(searchWords []string) ([]Note, error)

SearchInCommand returns notes by search word in command

func (*Yaml) SearchInDescription

func (y *Yaml) SearchInDescription(searchWords []string) ([]Note, error)

SearchInDescription returns notes by search word in description

func (*Yaml) SearchInTags

func (y *Yaml) SearchInTags(searchWords []string) ([]Note, error)

SearchInTags returns notes by search word in tags

Jump to

Keyboard shortcuts

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