rest

package
v0.0.0-...-b8344f8 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 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 BookList

type BookList struct {
	Items []BookModel `json:"items"`
}

BookList response model

func NewBookListModel

func NewBookListModel(bookList ...book.Book) BookList

NewBookListModel constructs a BookList model from a set of books

type BookModel

type BookModel struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Author  string `json:"author"`
	PubDate string `json:"pubdate"`
	Rating  int    `json:"rating"`
	Status  string `json:"status"`
}

BookModel is a response model for a book

func NewBookModel

func NewBookModel(book book.Book) BookModel

NewBookModel is the BookModel constructor

type ErrorResponse

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

ErrorResponse response model

type Server

type Server struct {
	http.Handler
	// contains filtered or unexported fields
}

Server is used to expose appliaction over a RESTful API

func NewServer

func NewServer(bookRepo usecase.BookReaderWriter, logger *internal.Logger) *Server

NewServer constructs a Server

Jump to

Keyboard shortcuts

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