44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
package book
|
|
|
|
// Book is a model for storing chapters, author, title, and total pages
|
|
type Book struct {
|
|
Title string `json:"title"`
|
|
Chapters []Chapter `json:"chapters"`
|
|
TotalPages int `json:"total_pages"`
|
|
}
|
|
|
|
// Chapter is a model that holds chaper number and pages within that chapter
|
|
type Chapter struct {
|
|
Index int `json:"index"` // Chapter number
|
|
Pages []Page `json:"pages"`
|
|
}
|
|
|
|
// Page is model that stores page number and paragraphs
|
|
type Page struct {
|
|
Index int `json:"index"`
|
|
Paragraphs []Paragraph `json:"paragraphs"`
|
|
}
|
|
|
|
// Paragraph is a model that stores paragraph number and lines
|
|
type Paragraph struct {
|
|
Index int `json:"index"`
|
|
Lines []Line `json:"lines"`
|
|
}
|
|
|
|
// Line is an interface for storing the content of a line
|
|
type Line struct {
|
|
Index int `json:"index"`
|
|
Content any `json:"content"`
|
|
}
|
|
|
|
// Dialogue is a model that stores the speaker, and text
|
|
type Dialogue struct {
|
|
Speaker *string `json:"speaker,omitempty"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
// Narration is a model that stores text that isnt dialogue
|
|
type Narration struct {
|
|
Content string `json:"content"`
|
|
|