Discover Packages
github.com/gdt-dev/http
test
server
package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Jul 30, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
func NewController(logger *log .Logger ) *server
func NewControllerWithBooks(logger *log .Logger , data []*Book ) *server
type Address struct {
Street string `json:"street"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postal_code"`
CountryCode string `json:"country_code"`
}
type Author struct {
ID string `json:"id"`
Name string `json:"name"`
}
type Book struct {
ID string `json:"id"`
Title string `json:"title"`
PublishedOn string `json:"published_on"`
Author *Author `json:"author"`
Publisher *Publisher `json:"publisher"`
Pages int `json:"pages"`
}
type CreateBookRequest struct {
Title string `json:"title"`
AuthorID string `json:"author_id"`
PublisherID string `json:"publisher_id"`
PublishedOn string `json:"published_on"`
Pages int `json:"pages"`
}
type ListBooksResponse struct {
Books []*Book `json:"books"`
}
type Publisher struct {
ID string `json:"id"`
Name string `json:"name"`
Address *Address `json:"address"`
}
type ReplaceBookRequest struct {
ID string `json:"id"`
Title string `json:"title"`
AuthorID string `json:"author_id"`
PublisherID string `json:"publisher_id"`
PublishedOn string `json:"published_on"`
Pages int `json:"pages"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.