notestorage

package
v0.0.0-...-435fad9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

notestorage provides data persistence logic, specifically for note models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoteStore

type NoteStore interface {
	CreateNote(note *notemodel.Note) error
	GetNoteByID(noteID uuid.UUID) (*notemodel.Note, error)
	GetNotesByUserID(userID uuid.UUID, limit, offset int) ([]*notemodel.Note, error)
	GetAllNotes(userID uuid.UUID) ([]*notemodel.Note, error)
	CheckNoteExists(noteID uuid.UUID) (bool, error)
	IsUserNoteOwner(noteID, userID uuid.UUID) bool
	DeleteNote(noteID uuid.UUID, userID uuid.UUID) error
	CheckNoteExistsAndBelongsToUser(noteID, userID uuid.UUID) (bool, error)
	UpdateNoteByID(noteID uuid.UUID, note *notemodel.Note) error
}

NoteStore provides methods for note operations.

func NewNoteStore

func NewNoteStore(db *gorm.DB) NoteStore

NewNoteStore creates a new instance of noteStore.

Jump to

Keyboard shortcuts

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