handler

package
v0.0.0-...-1c756da Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookDetails

type BookDetails struct {
	ID     string `json:"id"`
	Title  string `json:"title" validate:"required,gte=3"`
	Author string `json:"author" validate:"omitempty,gte=3"`
	Pages  int    `json:"pages" validate:"omitempty,gte=1"`
}

type BookID

type BookID struct {
	ID string `json:"id"`
}

type Books

type Books struct {
	Page    int           `json:"page"`
	PerPage int           `json:"perPage"`
	Items   []BookDetails `json:"items"`
}

type BooksHandler

type BooksHandler interface {
	Create(resp http.ResponseWriter, r *http.Request)
	Read(resp http.ResponseWriter, r *http.Request)
	ReadBooks(resp http.ResponseWriter, r *http.Request)
	Update(resp http.ResponseWriter, r *http.Request)
	Delete(resp http.ResponseWriter, r *http.Request)
}

func NewHttpHandler

func NewHttpHandler(bookService domain.Book) BooksHandler

type NewBook

type NewBook struct {
	Title  string `json:"title" validate:"required,gte=3"`
	Author string `json:"author" validate:"omitempty,gte=3"`
	Pages  int    `json:"pages" validate:"omitempty,gte=1"`
}

type UpdateBookDetails

type UpdateBookDetails struct {
	Title  *string `json:"title" validate:"omitempty,gte=3"`
	Author *string `json:"author" validate:"omitempty,gte=3"`
	Pages  *int    `json:"pages" validate:"omitempty,gte=1"`
}

Jump to

Keyboard shortcuts

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