storage

package
v0.0.0-...-7f7963c Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type Todo

type Todo struct {
	gorm.Model
	Title       string
	Description string
	Completed   *bool `gorm:"default:false"`
}

type TodoStorage

type TodoStorage interface {
	Get(ctx context.Context, id int) (Todo, error)
	List(ctx context.Context) ([]Todo, error)
	Create(ctx context.Context, todo *Todo) error
	Update(ctx context.Context, id int, todo Todo) error
	Delete(ctx context.Context, id int) error
}

func NewTodoStorage

func NewTodoStorage(lc fx.Lifecycle, db *gorm.DB) TodoStorage

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳