go-bouquins/bouquins/bouquins.go

102 lines
1.4 KiB
Go
Raw Normal View History

2017-07-30 14:06:38 +00:00
package bouquins
import "net/http"
type Bouquins struct {
}
2017-07-30 14:42:18 +00:00
/*
* A book series.
*/
type Series struct {
Id int64
Name string
}
/*
* A book. Generic data.
*/
type Book struct {
Id int64
Title string
SeriesIndex int
Series *Series
}
/*
* An author.
*/
type Author struct {
Id int64
Name string
}
/*
* Author and number of books.
*/
type AuthorAdv struct {
Author
Count int
}
/*
* Downloadable book data.
*/
type BookData struct {
Size int64
Format string
Name string
}
/*
* A book. Advanced data: authors, tags.
*/
type BookAdv struct {
Book
Authors []Author
Tags []string
}
type AuthorFull struct {
Author
Books []BookAdv
}
type BookFull struct {
BookAdv
Data []BookData
Timestamp int64
Pubdate int64
Isbn string
Lccn string
Path string
Uuid string
Has_cover bool
Lang string
Publisher string
}
type SeriesAdv struct {
Series
Books int64
Authors []Author
}
type SeriesFull struct {
SeriesAdv
Bools []Book
}
2017-07-30 14:06:38 +00:00
func (*Bouquins) IndexPage(res http.ResponseWriter, req *http.Request) {
http.Redirect(res, req, "/html/index.html", http.StatusSeeOther)
}
func (*Bouquins) BooksPage(res http.ResponseWriter, req *http.Request) {
panic("not implemented")
}
func (*Bouquins) AuthorsPage(res http.ResponseWriter, req *http.Request) {
panic("not implemented")
}
func (*Bouquins) SeriesPage(res http.ResponseWriter, req *http.Request) {
panic("not implemented")
}