Documentation
¶
Index ¶
- type Article
- type ArticleSummary
- type Catechism
- func (c *Catechism) GetArticle(partNumber, articleNumber int) (*Article, error)
- func (c *Catechism) GetIntroduction(partNumber int) (*Introduction, error)
- func (c *Catechism) GetIntroductionParagraph(partNumber, sectionNumber, paragraphNumber int) (*Paragraph, error)
- func (c *Catechism) GetIntroductionSection(partNumber, sectionNumber int) (*Section, error)
- func (c *Catechism) GetParagraph(partNumber, articleNumber, sectionNumber, paragraphNumber int) (*Paragraph, error)
- func (c *Catechism) GetPart(partNumber int) (*Part, error)
- func (c *Catechism) GetSection(partNumber, articleNumber, sectionNumber int) (*Section, error)
- func (c *Catechism) Search(query string, maxResults int) []SearchNode
- type Introduction
- type Paragraph
- type Part
- type PartSummary
- type SearchNode
- type Section
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
Title string `json:"title"`
Heading string `json:"heading"`
ArticleNumber uint8 `json:"articleNumber"`
Sections []Section `json:"sections"`
}
Article contains a list of sections. Heading holds the formal all-caps heading from the original Roman Catechism (e.g. the quoted commandment or petition text); Title is the navigable short form.
type ArticleSummary ¶
type ArticleSummary struct {
Title string `json:"title"`
Heading string `json:"heading"`
ArticleNumber uint8 `json:"articleNumber"`
}
ArticleSummary contains metadata for an article
type Catechism ¶
type Catechism struct {
Parts []Part `json:"-"`
PartSummary []PartSummary `json:"parts"`
// contains filtered or unexported fields
}
Catechism contains a list of parts
func NewCatechism ¶
func NewCatechism() *Catechism
NewCatechism parses and creates a new catechism instance
func (*Catechism) GetArticle ¶
GetArticle obtains an article within the catechism by its number
func (*Catechism) GetIntroduction ¶ added in v0.2.0
func (c *Catechism) GetIntroduction(partNumber int) (*Introduction, error)
GetIntroduction obtains the introduction for a given part
func (*Catechism) GetIntroductionParagraph ¶ added in v0.2.0
func (c *Catechism) GetIntroductionParagraph(partNumber, sectionNumber, paragraphNumber int) (*Paragraph, error)
GetIntroductionParagraph obtains a paragraph within a part's introduction
func (*Catechism) GetIntroductionSection ¶ added in v0.2.0
GetIntroductionSection obtains a section within a part's introduction
func (*Catechism) GetParagraph ¶
func (c *Catechism) GetParagraph(partNumber, articleNumber, sectionNumber, paragraphNumber int) (*Paragraph, error)
GetParagraph obtains a paragraph within the catechism by its number
func (*Catechism) GetSection ¶
GetSection obtains a section within the catechism by its number
type Introduction ¶ added in v0.2.0
type Introduction struct {
Sections []Section `json:"sections"`
}
Introduction contains preface sections for a part
type Part ¶
type Part struct {
Title string `json:"title"`
PartNumber uint8 `json:"partNumber"`
Introduction Introduction `json:"introduction"`
Articles []Article `json:"articles"`
}
Part contains a per-part introduction and a list of articles
type PartSummary ¶
type PartSummary struct {
Title string `json:"title"`
PartNumber uint8 `json:"partNumber"`
Articles []ArticleSummary `json:"articles"`
}
PartSummary contains metadata for a part
type SearchNode ¶
SearchNode represents a search result for a given paragraph inquiry. Article is nil when the match falls inside a part's Introduction.
func (*SearchNode) String ¶
func (s *SearchNode) String() string
String creates a string representation for the SearchNode, ex. Part 1, Article 1, Section 1, Paragraph 1; for hits inside a part's Introduction the form is Part N, Introduction, Section M, Paragraph K.
