store

package
v0.0.0-...-4b8b9da Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TodoInMemoryStore

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

func NewTodoInMemoryStore

func NewTodoInMemoryStore(available ...bool) *TodoInMemoryStore

func (*TodoInMemoryStore) Create

func (s *TodoInMemoryStore) Create(description string) error

func (*TodoInMemoryStore) Delete

func (s *TodoInMemoryStore) Delete(id string) error

func (*TodoInMemoryStore) Find

func (s *TodoInMemoryStore) Find(id string) (*domain.Todo, error)

func (*TodoInMemoryStore) FindAll

func (s *TodoInMemoryStore) FindAll() ([]*domain.Todo, error)

func (*TodoInMemoryStore) IsAvailable

func (s *TodoInMemoryStore) IsAvailable() bool

func (*TodoInMemoryStore) Update

func (s *TodoInMemoryStore) Update(id, description string, complete bool) error

type TodoPostgresStore

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

func NewTodoPostsgresStore

func NewTodoPostsgresStore(db *sql.DB, isAvailable bool) *TodoPostgresStore

func (*TodoPostgresStore) Create

func (s *TodoPostgresStore) Create(description string) error

func (*TodoPostgresStore) Delete

func (s *TodoPostgresStore) Delete(id string) error

func (*TodoPostgresStore) Find

func (s *TodoPostgresStore) Find(id string) (*domain.Todo, error)

func (*TodoPostgresStore) FindAll

func (s *TodoPostgresStore) FindAll() ([]*domain.Todo, error)

func (*TodoPostgresStore) IsAvailable

func (s *TodoPostgresStore) IsAvailable() bool

func (*TodoPostgresStore) Update

func (s *TodoPostgresStore) Update(id, description string, complete bool) error

type TodoStore

type TodoStore interface {
	IsAvailable() bool
	Create(description string) error
	Delete(id string) error
	Find(id string) (*domain.Todo, error)
	FindAll() ([]*domain.Todo, error)
	Update(id, description string, complete bool) error
}

Jump to

Keyboard shortcuts

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