adapters

package
v0.0.0-...-78a6f96 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoteInMemoryRepository

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

func NewNoteInMemoryRepository

func NewNoteInMemoryRepository() *NoteInMemoryRepository

func (*NoteInMemoryRepository) Create

func (r *NoteInMemoryRepository) Create(note domain.Note) error

func (*NoteInMemoryRepository) Delete

func (r *NoteInMemoryRepository) Delete(noteUUID uuid.UUID) error

func (*NoteInMemoryRepository) GetAllNotes

func (r *NoteInMemoryRepository) GetAllNotes() ([]domain.Note, error)

func (*NoteInMemoryRepository) GetNoteByUUID

func (r *NoteInMemoryRepository) GetNoteByUUID(noteUUID uuid.UUID) (domain.Note, error)

func (*NoteInMemoryRepository) Update

func (r *NoteInMemoryRepository) Update(
	noteUUID uuid.UUID,
	updateFn func(ctx context.Context, n *domain.Note) (*domain.Note, error),
) error

type NoteModel

type NoteModel struct {
	ID          uuid.UUID `gorm:"column:id;primaryKey"`
	Title       string    `gorm:"column:title"`
	Description string    `gorm:"column:description"`
	Timestamp   time.Time `gorm:"column:timestamp"`
}

func (NoteModel) TableName

func (NoteModel) TableName() string

type NotePostgresqlRepository

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

func NewNotePostgresqlRepository

func NewNotePostgresqlRepository(db *gorm.DB) *NotePostgresqlRepository

func (NotePostgresqlRepository) Create

func (n NotePostgresqlRepository) Create(note domain.Note) error

func (NotePostgresqlRepository) Delete

func (n NotePostgresqlRepository) Delete(noteUUID uuid.UUID) error

func (NotePostgresqlRepository) GetAllNotes

func (n NotePostgresqlRepository) GetAllNotes() ([]domain.Note, error)

func (NotePostgresqlRepository) GetNoteByUUID

func (n NotePostgresqlRepository) GetNoteByUUID(noteUUID uuid.UUID) (domain.Note, error)

func (NotePostgresqlRepository) Update

func (n NotePostgresqlRepository) Update(noteUUID uuid.UUID, updateFn func(ctx context.Context, n *domain.Note) (*domain.Note, error)) error

Jump to

Keyboard shortcuts

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