fetch

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOST = "https://4.dbt.io/api/"
)

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(ctx context.Context, url string, desc string) ([]byte, *log.Status)

Types

type APIDBPClient

type APIDBPClient struct {
	// contains filtered or unexported fields
}

func NewAPIDBPClient

func NewAPIDBPClient(ctx context.Context, bibleId string) APIDBPClient

func (*APIDBPClient) BibleInfo

func (d *APIDBPClient) BibleInfo() (BibleInfoType, *log.Status)

func (*APIDBPClient) FindFilesets

func (d *APIDBPClient) FindFilesets(info *BibleInfoType, audio request.BibleBrainAudio,
	text request.BibleBrainText, testament request.Testament)

func (*APIDBPClient) UpdateIdent

func (d *APIDBPClient) UpdateIdent(id db.Ident, info BibleInfoType, req request.Request) (db.Ident, *log.Status)

type APIDBPTimestamps

type APIDBPTimestamps struct {
	// contains filtered or unexported fields
}

func NewAPIDBPTimestamps

func NewAPIDBPTimestamps(conn db.DBAdapter, audioId string) APIDBPTimestamps

func (*APIDBPTimestamps) HavingTimestamps

func (a *APIDBPTimestamps) HavingTimestamps() (map[string]bool, *log.Status)

func (*APIDBPTimestamps) LoadTimestamps

func (a *APIDBPTimestamps) LoadTimestamps(testament request.Testament) (bool, *log.Status)

func (*APIDBPTimestamps) Timestamps

func (a *APIDBPTimestamps) Timestamps(bookId string, chapter int) ([]Timestamp, *log.Status)

type APIDownloadClient

type APIDownloadClient struct {
	// contains filtered or unexported fields
}

func NewAPIDownloadClient

func NewAPIDownloadClient(ctx context.Context, bibleId string, testament request.Testament) APIDownloadClient

func (*APIDownloadClient) Download

func (d *APIDownloadClient) Download(info BibleInfoType) *log.Status

type AlphabetType

type AlphabetType struct {
	Alphabet string `json:"script"`
}

type BibleInfoRespType

type BibleInfoRespType struct {
	Data BibleInfoType `json:"data"`
}

type BibleInfoType

type BibleInfoType struct {
	BibleId            string       `json:"abbr"`
	LanguageISO        string       `json:"iso"`
	LanguageId         int          `json:"language_id"`
	RolvId             string       `json:"language_rolv_code"`
	LanguageName       string       `json:"language"`
	VersionName        string       `json:"name"`
	Alphabet           AlphabetType `json:"alphabet"` // alphabet.script
	Copyright          string       `json:"mark"`
	Books              []BooksType  `json:"books"`
	DbpProd            DbpProdType  `json:"filesets"`
	VersionCode        string
	AudioOTFileset     FilesetType
	AudioNTFileset     FilesetType
	TextOTPlainFileset FilesetType
	TextNTPlainFileset FilesetType
	TextOTUSXFileset   FilesetType
	TextNTUSXFileset   FilesetType
}

type BooksType

type BooksType struct {
	BookId    string `json:"book_id"`
	Name      string `json:"name"`
	Chapters  []int  `json:"chapters"`
	BookSeq   string `json:"book_seq"`
	Testament string `json:"testament"`
}

type DbpProdType

type DbpProdType struct {
	Filesets []FilesetType `json:"dbp-prod"`
}

type FilesetType

type FilesetType struct {
	Id        string `json:"id"`
	Type      string `json:"type"`
	Size      string `json:"size"`
	Codec     string `json:"codec"`
	Container string `json:"container"`
	Bitrate   string `json:"bitrate"`
}

type LocationDownloadRec

type LocationDownloadRec struct {
	Data []LocationRec `json:"data"`
	Meta any           `json:"meta"`
}

type LocationRec

type LocationRec struct {
	BookId   string `json:"book_id"`
	BookName string `json:"book_name"`
	Chapter  int    `json:"chapter_start"`
	Verse    int    `json:"verse_start"`
	URL      string `json:"path"`
	FileSize int    `json:"filesize_in_bytes"`
	Filename string
}

type Timestamp

type Timestamp struct {
	BookId        string  `json:"book"`
	Chapter       string  `json:"chapter"`
	VerseStart    string  `json:"verse_start"`
	VerseStartAlt string  `json:"verse_start_alt"`
	Timestamp     float64 `json:"timestamp"`
}

func (*Timestamp) Key

func (t *Timestamp) Key() string

type TimestampsResp

type TimestampsResp struct {
	Data []Timestamp `json:"data"`
}

Jump to

Keyboard shortcuts

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