Documentation
¶
Index ¶
- Variables
- func Decode[T any](data []byte, target *T) error
- func Encode(data any) ([]byte, error)
- func Harden(gcm cipher.AEAD, input any) ([]byte, error)
- func NewGCM(key []byte) (cipher.AEAD, error)
- func Soften[T any](gcm cipher.AEAD, encrypted []byte, target *T) error
- type BoltStorage
- func (b BoltStorage) Close() error
- func (b BoltStorage) Create(name, initialText string) (Entry, Index, error)
- func (b BoltStorage) Delete(id uuid.UUID) (Index, error)
- func (b BoltStorage) Index() (Index, error)
- func (b BoltStorage) MoveDown(id uuid.UUID) (Index, error)
- func (b BoltStorage) MoveUp(id uuid.UUID) (Index, error)
- func (b BoltStorage) Read(id uuid.UUID) (Entry, error)
- func (b BoltStorage) Rename(id uuid.UUID, newName string) (Index, error)
- func (b BoltStorage) Update(entry Entry) error
- type Entry
- type EntryMeta
- type Index
- type Note
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotImplemented = errors.New("feature not implemented") ErrAlreadyClosed = errors.New("storage is closed") ErrInvalidStorage = errors.New("invalid storage") ErrInvalidKey = errors.New("invalid key provided") ErrNoSuchEntry = errors.New("no such entry") ErrNoIndex = errors.New("no index present") )
Functions ¶
Types ¶
type BoltStorage ¶
type BoltStorage struct {
// contains filtered or unexported fields
}
func (BoltStorage) Close ¶
func (b BoltStorage) Close() error
func (BoltStorage) Create ¶
func (b BoltStorage) Create(name, initialText string) (Entry, Index, error)
func (BoltStorage) Index ¶
func (b BoltStorage) Index() (Index, error)
func (BoltStorage) Update ¶
func (b BoltStorage) Update(entry Entry) error
type Storage ¶
type Storage interface {
Close() error
Index() (Index, error)
Rename(id uuid.UUID, newName string) (Index, error)
MoveUp(id uuid.UUID) (Index, error)
MoveDown(id uuid.UUID) (Index, error)
Create(name, initialText string) (Entry, Index, error)
Read(id uuid.UUID) (Entry, error)
Update(entry Entry) error
Delete(id uuid.UUID) (Index, error)
}
Click to show internal directories.
Click to hide internal directories.