Documentation
¶
Index ¶
- type Book
- type BooksRequest
- type BooksResponse
- type Chapter
- type ChaptersRequest
- type ChaptersResponse
- type Collection
- type CollectionsRequest
- type CollectionsResponse
- type Hadith
- type HadithsRequest
- type HadithsResponse
- type SunnahService
- func (t *SunnahService) Books(request *BooksRequest) (*BooksResponse, error)
- func (t *SunnahService) Chapters(request *ChaptersRequest) (*ChaptersResponse, error)
- func (t *SunnahService) Collections(request *CollectionsRequest) (*CollectionsResponse, error)
- func (t *SunnahService) Hadiths(request *HadithsRequest) (*HadithsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BooksRequest ¶
type BooksResponse ¶
type ChaptersRequest ¶
type ChaptersResponse ¶
type ChaptersResponse struct {
// number of the book
Book int32 `json:"book"`
// The chapters of the book
Chapters []Chapter `json:"chapters"`
// name of the collection
Collection string `json:"collection"`
// Limit the number of chapters returned
Limit int32 `json:"limit"`
// The page in the pagination
Page int32 `json:"page"`
// Total chapters in the book
Total int32 `json:"total"`
}
type Collection ¶
type Collection struct {
// Arabic title if available
ArabicTitle string `json:"arabicTitle"`
// Total hadiths in the collection
Hadiths int32 `json:"hadiths"`
// Name of the collection e.g bukhari
Name string `json:"name"`
// An introduction explaining the collection
Summary string `json:"summary"`
// Title of the collection e.g Sahih al-Bukhari
Title string `json:"title"`
}
type CollectionsRequest ¶
type CollectionsResponse ¶
type CollectionsResponse struct {
Collections []Collection `json:"collections"`
}
type Hadith ¶
type Hadith struct {
// the arabic chapter title
ArabicChapterTitle string `json:"arabicChapterTitle"`
// the arabic text
ArabicText string `json:"arabicText"`
// the chapter id
Chapter int32 `json:"chapter"`
// the chapter key
ChapterKey string `json:"chapterKey"`
// the chapter title
ChapterTitle string `json:"chapterTitle"`
// hadith id
Id int32 `json:"id"`
// hadith text
Text string `json:"text"`
}
type HadithsRequest ¶
type HadithsResponse ¶
type HadithsResponse struct {
// number of the book
Book int32 `json:"book"`
// name of the collection
Collection string `json:"collection"`
// The hadiths of the book
Hadiths []Hadith `json:"hadiths"`
// Limit the number of hadiths returned
Limit int32 `json:"limit"`
// The page in the pagination
Page int32 `json:"page"`
// Total hadiths in the book
Total int32 `json:"total"`
}
type SunnahService ¶
type SunnahService struct {
// contains filtered or unexported fields
}
func NewSunnahService ¶
func NewSunnahService(token string) *SunnahService
func (*SunnahService) Books ¶
func (t *SunnahService) Books(request *BooksRequest) (*BooksResponse, error)
Get a list of books from within a collection. A book can contain many chapters each with its own hadiths.
func (*SunnahService) Chapters ¶
func (t *SunnahService) Chapters(request *ChaptersRequest) (*ChaptersResponse, error)
Get all the chapters of a given book within a collection.
func (*SunnahService) Collections ¶
func (t *SunnahService) Collections(request *CollectionsRequest) (*CollectionsResponse, error)
Get a list of available collections. A collection is a compilation of hadiths collected and written by an author.
func (*SunnahService) Hadiths ¶
func (t *SunnahService) Hadiths(request *HadithsRequest) (*HadithsResponse, error)
Hadiths returns a list of hadiths and their corresponding text for a given book within a collection.
Click to show internal directories.
Click to hide internal directories.