todo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateStruct

func ValidateStruct(request createTodoRequest) *utils.ApiError

Types

type ITodoService added in v0.3.0

type ITodoService interface {
	GetAll() ([]Todo, error)
	Create(name string) error
}

func NewService added in v0.3.0

func NewService(todoStore TodoStore) ITodoService

type Tabler

type Tabler interface {
	TableName() string
}

type Todo

type Todo struct {
	ID   int    `json:"id" gorm:"primaryKey"`
	Name string `json:"name"`
}

func (Todo) TableName

func (Todo) TableName() string

type TodoHandler

type TodoHandler struct {
	Service ITodoService
}

func (*TodoHandler) CreateTodo

func (h *TodoHandler) CreateTodo(c *fiber.Ctx) error

CreateTodo godoc @Summary CreateTodo @Description CreateTodo @Tags todo @Accept json @Param customername body createTodoRequest true "customername" @Produce json @Success 201 @Router /customers [post]

func (*TodoHandler) GetAll

func (h *TodoHandler) GetAll(c *fiber.Ctx) error

GetAll godoc @Summary Get all todo @Description get all todo @Tags todo @Produce json @Success 200 {array} CustomerCompleteInfo @Router /todos [get]

type TodoStore

type TodoStore interface {
	//
	GetAll() ([]Todo, error)
	Create(todo *Todo) error
}

func NewStore added in v0.3.0

func NewStore(db *gorm.DB) TodoStore

Jump to

Keyboard shortcuts

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