handler

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTodoHandler

func RegisterTodoHandler(e *gin.Engine, s storage.TodoStorage) error

Types

type CreateTodoReq

type CreateTodoReq struct {
	Title       string `json:"title" binding:"required"`
	Description string `json:"description"`
}

type ErrorRes

type ErrorRes struct {
	Error string `json:"error"`
}

type GetTodoRes

type GetTodoRes struct {
	ID          uint      `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description,omitempty"`
	Completed   bool      `json:"completed"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type ListTodoRes

type ListTodoRes []GetTodoRes

type TodoHandler

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

func (*TodoHandler) Create

func (h *TodoHandler) Create(c *gin.Context)

func (*TodoHandler) Delete

func (h *TodoHandler) Delete(c *gin.Context)

func (*TodoHandler) Get

func (h *TodoHandler) Get(c *gin.Context)

func (*TodoHandler) List

func (h *TodoHandler) List(c *gin.Context)

func (*TodoHandler) Update

func (h *TodoHandler) Update(c *gin.Context)

type UpdateTodoReq

type UpdateTodoReq struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Completed   *bool  `json:"completed"`
}

Jump to

Keyboard shortcuts

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