book

package
v0.0.0-...-a28d39e Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint interface {
	Find(c fiber.Ctx) error
	FindByID(c fiber.Ctx) error
	Create(c fiber.Ctx) error
	Update(c fiber.Ctx) error
	Delete(c fiber.Ctx) error
}

endpoint interface

func NewEndpoint

func NewEndpoint() Endpoint

type Repository

type Repository interface {
	Find(db *gorm.DB, req *Request) (*models.Book, error)
	FindByID(db *gorm.DB, id uint, i interface{}) error
	Create(db *gorm.DB, i interface{}) error
	Update(db *gorm.DB, m, i interface{}) error
	Delete(db *gorm.DB, i interface{}) error
}

repository interface

func NewRepository

func NewRepository() Repository

type Request

type Request struct {
	Name string `json:"name" query:"name"`
}

type RequestCreate

type RequestCreate struct {
	Name        string `json:"name" validate:"required"`
	Description string `json:"description"`
	Author      string `json:"author"`
}

type RequestID

type RequestID struct {
	ID uint `json:"-" path:"id" form:"id" query:"id" validate:"required"`
}

type RequestUpdate

type RequestUpdate struct {
	RequestID
	Name        string `json:"name" validate:"required"`
	Description string `json:"description"`
	Author      string `json:"author"`
}

type Service

type Service interface {
	Find(c *cctx.Context, req *Request) (interface{}, error)
	FindByID(c *cctx.Context, req *RequestID) (interface{}, error)
	Create(c *cctx.Context, req *RequestCreate) (interface{}, error)
	Update(c *cctx.Context, req *RequestUpdate) (interface{}, error)
	Delete(c *cctx.Context, req *RequestID) error
}

service interface

func NewService

func NewService() Service

Jump to

Keyboard shortcuts

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