all repos — bibel @ 0be549fc2abddcf0f0e574436c2607ed7f844ab0

Unnamed repository; edit this file 'description' to name the repository.

internal/verse.go (view raw)

 1package bible
 2
 3// Verse represents a single Bible verse
 4type Verse struct {
 5	BookName string `json:"book_name"`
 6	Book     int    `json:"book"`
 7	Chapter  int    `json:"chapter"`
 8	VerseNum int    `json:"verse"`
 9	Text     string `json:"text"`
10}
11
12// VerseRange represents a range of verses (inclusive)
13type VerseRange struct {
14	Book       int
15	Chapter    int
16	FirstVerse int
17	LastVerse  int
18}
19
20// BookIndex represents the four Gospels
21type BookIndex int
22
23const (
24	Matthew BookIndex = iota + 40
25	Mark
26	Luke
27	John
28)
29
30func (b BookIndex) String() string {
31	switch b {
32	case Matthew:
33		return "Ewangelia wg. Mateusza"
34	case Mark:
35		return "Ewangelia wg. Marka"
36	case Luke:
37		return "Ewangelia wg. Ɓukasza"
38	case John:
39		return "Ewangelia wg. Jana"
40	default:
41		return "Unknown"
42	}
43}
44
45// Bookmark represents the current reading position
46type Bookmark struct {
47	Book        BookIndex `toml:"book"`
48	Chapter     int       `toml:"chapter"`
49	FirstVerse  int       `toml:"first_verse"`
50	SecondVerse int       `toml:"second_verse"`
51}
52