notes

package
v0.0.0-...-ea5f57a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresNotesRepository

type PostgresNotesRepository struct {
	// contains filtered or unexported fields
}

local database models.

func (PostgresNotesRepository) CreateNewNote

func (p PostgresNotesRepository) CreateNewNote(ctx context.Context, note *model.Note) (*model.Note, error)

func (PostgresNotesRepository) ExistsNoteWithID

func (p PostgresNotesRepository) ExistsNoteWithID(ctx context.Context, noteId string) (bool, error)

func (PostgresNotesRepository) GetAllNotes

func (p PostgresNotesRepository) GetAllNotes(ctx context.Context) ([]*model.Note, error)

func (PostgresNotesRepository) UpdateNote

func (p PostgresNotesRepository) UpdateNote(ctx context.Context, noteId string, note *model.Note) (*model.Note, error)

type Repository

type Repository interface {
	CreateNewNote(ctx context.Context, note *model.Note) (*model.Note, error)
	GetAllNotes(ctx context.Context) ([]*model.Note, error)
	UpdateNote(ctx context.Context, noteId string, note *model.Note) (*model.Note, error)
	ExistsNoteWithID(ctx context.Context, noteId string) (bool, error)
}

func ProvideNewNotesRepository

func ProvideNewNotesRepository(db *db.Database) (Repository, error)

type Service

type Service interface {
	SaveNewNote(ctx context.Context, newNoteInput model.NewNoteInput) (*model.Note, error)
	GetAllNotes(ctx context.Context) ([]*model.Note, error)
}

func ProvideNewNotesService

func ProvideNewNotesService(notesRepository Repository, transactionManager db.TransactionManager) (Service, error)

Jump to

Keyboard shortcuts

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