sunnah

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	// arabic name of the book
	ArabicName string `json:"arabicName"`
	// number of hadiths in the book
	Hadiths int32 `json:"hadiths"`
	// number of the book e.g 1
	Id int32 `json:"id"`
	// name of the book
	Name string `json:"name"`
}

type BooksRequest

type BooksRequest struct {
	// Name of the collection
	Collection string `json:"collection"`
	// Limit the number of books returned
	Limit int32 `json:"limit"`
	// The page in the pagination
	Page int32 `json:"page"`
}

type BooksResponse

type BooksResponse struct {
	// A list of books
	Books []Book `json:"books"`
	// Name of the collection
	Collection string `json:"collection"`
	// The limit specified
	Limit int32 `json:"limit"`
	// The page requested
	Page int32 `json:"page"`
	// The total overall books
	Total int32 `json:"total"`
}

type Chapter

type Chapter struct {
	// arabic title
	ArabicTitle string `json:"arabicTitle"`
	// the book number
	Book int32 `json:"book"`
	// the chapter id e.g 1
	Id int32 `json:"id"`
	// the chapter key e.g 1.00
	Key string `json:"key"`
	// title of the chapter
	Title string `json:"title"`
}

type ChaptersRequest

type ChaptersRequest struct {
	// number of the book
	Book int32 `json:"book"`
	// 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"`
}

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 CollectionsRequest struct {
	// Number of collections to limit to
	Limit int32 `json:"limit"`
	// The page in the pagination
	Page int32 `json:"page"`
}

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 HadithsRequest struct {
	// number of the book
	Book int32 `json:"book"`
	// name of the collection
	Collection string `json:"collection"`
	// Limit the number of hadiths
	Limit int32 `json:"limit"`
	// The page in the pagination
	Page int32 `json:"page"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL