Skip to content

Instantly share code, notes, and snippets.

@chebykinn
Created February 13, 2023 02:12
Show Gist options
  • Save chebykinn/0c2905f07d76082bd9d63a56a720371c to your computer and use it in GitHub Desktop.
Save chebykinn/0c2905f07d76082bd9d63a56a720371c to your computer and use it in GitHub Desktop.
Todo models definitions
package domain
import (
"time"
"example.com/namespace/todo-app/go-services/internal/todo-backend/generated/core"
)
type TodoNote struct {
ID int64
Title string
Description string
IsCompleted bool
CreatedAt time.Time
UpdatedAt time.Time
}
// Storage interface with it we can choose different implementations and write
// unit tests.
type TodoStorage interface {
InsertTodoNote(ctx *core.MifyRequestContext, todoNote TodoNote) (TodoNote, error)
UpdateTodoNote(ctx *core.MifyRequestContext, todoNote TodoNote) (TodoNote, error)
SelectTodoNote(ctx *core.MifyRequestContext, id int64) (TodoNote, error)
DeleteTodoNote(ctx *core.MifyRequestContext, id int64) error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment