hadith

package
v0.0.0-...-a938e7c Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadDirHadith

func ReadDirHadith(filePath string) ([]string, error)

handle read directory of ./data/hadith/

func RemoveExtention

func RemoveExtention(fileNames []string, filePath string) ([]string, error)

handle to remove file extention

Types

type Data

type Data struct {
	Arabic    string    `json:"arabic"`
	Number    int       `json:"number"`
	Translate Translate `json:"translate"`
}

type Hadith

type Hadith struct {
	Number int    `json:"number"`
	Arab   string `json:"arab"`
	ID     string `json:"id"`
}

func HadithPagination

func HadithPagination(page, perPage int, hadiths []Hadith) ([]Hadith, error)

implement pagination to limit data return of hadith's

func ReadFileHadith

func ReadFileHadith(author, filePath string) ([]Hadith, error)

handle read file hadith form path data ./data/hadith/:author

type IHadith

type IHadith interface {
	GetAuthor(c *fiber.Ctx) error
	GetHadith(c *fiber.Ctx) error
}

contract of hadith

func New

func New() IHadith

type ResponseHadith200Ok

type ResponseHadith200Ok struct {
	StatusCode  int    `json:"status_code"`
	Author      string `json:"author"`
	TotalHadith int    `json:"total_hadith"`
	Page        int    `json:"page"`
	PerPage     int    `json:"per_page"`
	Data        []Data `json:"data"`
}

type Translate

type Translate struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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