data

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRunningOnHomelessShelter = errors.New("running on homeless shelter")

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Notes    map[string]models.Note `json:"notes"`
	Metadata Metadata               `json:"metadata"`
	// contains filtered or unexported fields
}

func Load added in v3.2.1

func Load(logger *zerolog.Logger, config *config.App) (*Buffer, error)

func (*Buffer) Commit

func (b *Buffer) Commit(keys ...string) error

Saves the current state of the data in the file. If the file doesn't exists then it will be created.

func (*Buffer) Undo

func (b *Buffer) Undo(keys ...string) error

type KeyTag

type KeyTag struct {
	Key string `json:"key"`
	Tag string `json:"tag"`
}

type Metadata

type Metadata struct {
	// The key of the last accessed note.
	LastCreated KeyTag `json:"lastCreated,omitempty"`
	// The key of the last accessed/modified note.
	LastAccess KeyTag `json:"lastAccess,omitempty"`
}

Jump to

Keyboard shortcuts

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