handler

package
v0.0.0-...-5f2b7d0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler defines a handler struct

func NewHandler

func NewHandler(dbSvc services.IdbService, bSvc services.Ibooks) *Handler

NewHandler returns a new instance of Handler

func (*Handler) GetBook

func (h *Handler) GetBook(c echo.Context) (err error)

GetBook resolves GET /{userID}/book/{isbn}, retreives details of a book from database

func (*Handler) GetNewBook

func (h *Handler) GetNewBook(c echo.Context) (err error)

GetNewBook resolves GET /book/:isbn, retreives details of a book from providers.

func (*Handler) ListBook

func (h *Handler) ListBook(c echo.Context) (err error)

ListBook resolves GET /{userID}/books, retreives the list of books related to the userID

func (*Handler) Ping

func (h *Handler) Ping(c echo.Context) (err error)

Ping resolves GET /ping, returns "Pong", used for healthcheck.

func (*Handler) UpsertBook

func (h *Handler) UpsertBook(c echo.Context) (err error)

UpsertBook resolves POST /{userID}/book, updates a database book record if record is found, creates a new record if no record found.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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