structs

package
v0.0.0-...-8291da2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: GPL-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 ApisPubMediaGETPUBMEDIALINKS struct {
	Status struct {
		ID     string `json:"id"`
		Title  string `json:"title"`
		Status int    `json:"status"`
	} `json:"0"`
	PubName       string   `json:"pubName"`
	ParentPubName string   `json:"parentPubName"`
	Booknum       string   `json:"booknum"` // idk, is null
	Pub           string   `json:"pub"`     // the codename
	Issue         string   `json:"issue"`
	FormattedDate string   `json:"formattedDate"`
	FileFormat    []string `json:"fileFormat"`
	Track         string   `json:"track"`     // idk, is null
	Specialty     string   `json:"Specialty"` // idk, is empty string
	PubImage      struct {
		URL              string `json:"url"`
		ModifiedDatetime string `json:"modifiedDateTime"`
		Checksum         string `json:"checksum"`
	} `json:"pubImage"`
	Languages map[string]struct {
		Name      string `json:"name"`
		Direction string `json:"direction"`
		Locale    string `json:"locale"`
	} `json:"languages"`
	Files map[string]map[string][]struct {
		Title string `json:"title"`
		File  struct {
			URL              string `json:"url"`
			Stream           string `json:"stream"`
			ModifiedDatetime string `json:"modifiedDatetime"`
			Checksum         string `json:"checksum"`
		} `json:"file"`
		Filesize   int
		TrackImage struct {
			URL              string `json:"url"`
			ModifiedDatetime string `json:"modifiedDatetime"`
			Checksum         string `json:"checksum"`
		} `json:"trackImage"`
		Markers        string `json:"markers"` // idk, is null
		Label          string `json:"label"`
		Track          string `json:"track"`
		HasTrack       bool   `json:"hasTrack"`
		Pub            string `json:"pub"`
		Docid          int    `json:"docid"`
		Booknum        int    `json:"booknum"`
		Mimetype       string `json:"mimetype"`
		Edition        string `json:"edition"`
		EditionDescr   string `json:"editionDescr"`
		Format         string `json:"format"`
		FormatDescr    string `json:"formatDescr"`
		Specialty      string `json:"specialty"`
		SpecialtyDescr string `json:"specialtyDescr"`
		Subtitled      bool   `json:"subtitled"`
		FrameWidth     int    `json:"frameWidth"`
		FrameHeight    int    `json:"frameHeight"`
		FrameRate      int    `json:"frameRate"`
		Duration       int    `json:"duration"`
		BitRate        int    `json:"bitRate"`
	} `json:"files"`
}

ApisPubMediaGETPUBMEDIALINKS format output from https://app.jw-cdn.org/apis/pub-media/GETPUBMEDIALINKS?langwritten=E&pub=S-38&fileformat=epub

type ApisStatus

type ApisStatus struct {
	ID     string `json:"id"`
	Title  string `json:"title"`
	Status int    `json:"status"`
}

ApisStatus - this hold status of api, when something goes wrong

type CatalogsPublicationsV4Manifest

type CatalogsPublicationsV4Manifest struct {
	Version int    `json:"version"`
	Current string `json:"current"`
}

CatalogsPublicationsV4Manifest is meant to receive part of url required to get catalog.db curl --silent https://app.jw-cdn.org/catalogs/publications/v4/manifest.json | jq

{
	"version": 1,
	"current": "815ecc5a-e72b-48ac-aa9f-e1e7d256e43b"
}

type DBAvailableBibleBook

type DBAvailableBibleBook struct {
	Book          int `json:"book"`
	PublicationID int `json:"publication_id"`
}

DBAvailableBibleBook -

type DBCuratedAsset

type DBCuratedAsset struct {
	ListType           int `json:"list_type"`
	SortOrder          int `json:"sort_order"`
	PublicationAssetID int `json:"publication_asset_id"`
}

DBCuratedAsset -

type DBDatedText

type DBDatedText struct {
	Class         int    `json:"class"`
	Start         string `json:"start"`
	End           string `json:"end"`
	PublicationID int    `json:"publication_id"`
}

DBDatedText -

type DBImageAsset

type DBImageAsset struct {
	Width        int    `json:"width"`
	Height       int    `json:"height"`
	NameFragment string `json:"name_fragment"`
	Size         int    `json:"size"`
	MimeType     string `json:"mime_type"`
	ID           int    `json:"id"`
}

DBImageAsset -

type DBPublication

type DBPublication struct {
	PublicationRootKeyID  int    `json:"publication_root_key_id"`
	MepsLanguageID        int    `json:"meps_language_id"`
	PublicationTypeID     int    `json:"publication_type_id"`
	IssueTagNumber        int    `json:"issue_tag_number"`
	Title                 string `json:"title"`
	IssueTitle            string `json:"issue_title"` // notnull 0
	ShortTitle            string `json:"short_title"`
	CoverTitle            string `json:"cover_title"`             // notnull 0
	UndatedTitle          string `json:"undated_title"`           // notnull 0
	UndatedReferenceTitle string `json:"undated_reference_title"` // notnull 0
	Year                  int    `json:"year"`                    // should be smallint (int8), I'll go for int now
	Symbol                string `json:"symbol"`
	KeySymbol             string `json:"key_symbol"` // notnull 0 | varchar(16)
	Reserved              int    `json:"reserved"`
	ID                    int    `json:"id"`
}

DBPublication -

type DBPublicationAsset

type DBPublicationAsset struct {
	PublicationID              int    `json:"publication_id"`
	MepsLanguageID             int    `json:"meps_language_id"`
	Signature                  string `json:"signature"`
	Size                       int    `json:"size"`
	ExpandedSize               int    `json:"expanded_size"`
	MimeType                   string `json:"mime_type"`
	SchemaVersion              int    `json:"schema_version"`
	MinPlatformVersion         int    `json:"min_platform_version"`
	CatalogedOn                string `json:"cataloged_on"`
	LastUpdated                string `json:"last_updated"`
	LastModified               string `json:"last_modified"`
	GenerallyAvailableDate     string `json:"generally_available_date"`      // notnull 0
	ConventionReleaseDayNumber int    `json:"convention_release_day_number"` // notnull 0
	ID                         int    `json:"id"`
}

DBPublicationAsset -

type DBPublicationAssetImageMap

type DBPublicationAssetImageMap struct {
	PublicationAssetID int `json:"publication_asset_id"`
	ImageAssetID       int `json:"image_asset_id"`
}

DBPublicationAssetImageMap -

type DBPublicationAttribute

type DBPublicationAttribute struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
}

DBPublicationAttribute -

type DBPublicationAttributeMap

type DBPublicationAttributeMap struct {
	PublicationID          int `json:"publication_id"`
	PublicationAttributeID int `json:"publication_attribute_id"`
}

DBPublicationAttributeMap -

type DBPublicationDocument

type DBPublicationDocument struct {
	DocumentID    int `json:"document_id"`
	PublicationID int `json:"publication_id"`
}

DBPublicationDocument -

type DBPublicationRootKey

type DBPublicationRootKey struct {
	Symbol   string `json:"symbol"`
	Year     int    `json:"year"` // notnull 0 | should be smallint (int8)
	Language int    `json:"language"`
	ID       int    `json:"id"`
}

DBPublicationRootKey -

type DBRevision

type DBRevision struct {
	Level   int    `json:"level"`
	Created string `json:"created"`
}

DBRevision -

type EPUBContentOpf

type EPUBContentOpf struct {
	XMLName          xml.Name `xml:"package"`
	Version          string   `xml:"version,attr"`
	Xmlns            string   `xml:"xmlns,attr"`
	UniqueIdentifier string   `xml:"unique-identifier,attr"`
	Metadata         struct {
		XMLName   xml.Name `xml:"metadata"`
		DC        string   `xml:"dc,attr"`
		OPF       string   `xml:"opf,attr"`
		DCTitle   string   `xml:"title"`
		DCCreator struct {
			XMLName xml.Name `xml:"creator"`
			Name    string   `xml:",chardata"`
			ID      string   `xml:"id,attr"`
			XMLLang string   `xml:"lang,attr"`
			Dir     string   `xml:"dir,attr"`
		}
		Meta []struct {
			XMLName  xml.Name `xml:"meta"`
			Value    string   `xml:",chardata"`
			Name     string   `xml:"name,attr"`
			Content  string   `xml:"contant,attr"`
			Refines  string   `xml:"refines,attr"`
			Property string   `xml:"property,attr"`
			Scheme   string   `xml:"scheme,attr"`
			ID       string   `xml:"id,attr"`
		} `xml:"meta"` // There are multiple meta tags
		DCLanguage   string `xml:"language"`
		DCPublisher  string `xml:"publisher"`
		DCIdentifier struct {
			XMLName xml.Name `xml:"identifier"`
			ID      string   `xml:"id,attr"`
			Name    string   `xml:",chardata"`
		}
	} // </metadata>
	Manifest struct {
		XMLName xml.Name `xml:"manifest"`
		Items   []struct {
			XMLName    xml.Name `xml:"item"`
			ID         string   `xml:"id,attr"`
			Properties string   `xml:"properties,attr"`
			Href       string   `xml:"href,attr"`
			MediaType  string   `xml:"media-type,attr"`
		} `xml:"item"`
	} // </manifest>
	Spine struct {
		XMLName                  xml.Name `xml:"spine"`
		Toc                      string   `xml:"toc,attr"`
		PageProgressionDirection string   `xml:"page-progression-direction,attr"`
		ItemRefs                 []struct {
			XMLName xml.Name `xml:"itemref"`
			IDRef   string   `json:"idref,attr"`
			Linear  string   `json:"no"`
		} `xml:"itemref"`
	} // </spine>
	Guide struct {
		XMLName xml.Name `xml:"guide"`
		Type    string   `xml:"type,attr"`
		Href    string   `xml:"href,attr"`
		Title   string   `xml:"title,attr"`
	}
}

EPUBContentOpf - This is supposed to read content.obf into some readable thing

type EPUBTocNcx

type EPUBTocNcx struct {
	XMLName xml.Name `xml:"ncx"`
	Version string   `xml:"version,attr"`
	Lang    string   `xml:"lang,attr"`
	Xmlns   string   `xml:"xmlns,attr"`
	Head    struct {
		XMLName xml.Name `xml:"head"`
		Meta    []struct {
			XMLName xml.Name `xml:"meta"`
			Name    string   `xml:"name,attr"`
			Content string   `xml:"contant,attr"`
		} `xml:"meta"`
	}
	DocTitle struct {
		XMLName xml.Name `xml:"docTitle"`
		Text    string   `xml:"text"`
	}
	DocAuthor struct {
		XMLName xml.Name `xml:"docAuthor"`
		Text    string   `xml:"text"`
	}
	NavMap struct {
		XMLName  xml.Name `xml:"navMap"`
		NavPoint []struct {
			XMLName   xml.Name `xml:"navPoint"`
			Class     string   `xml:"class,attr"`
			ID        string   `xml:"id,attr"`
			PlayOrder string   `xml:"playOrder,attr"` // Maybe it should be int?
			NavLabel  struct {
				XMLName xml.Name `xml:"navLabel"`
				Text    string   `xml:"text"`
			}
			Content struct {
				XMLName xml.Name `xml:"content"`
				Src     string   `xml:"src,attr"`
			}
		} `xml:"navPoint"`
	}
}

EPUBTocNcx - This is supposed to read toc.ncx into some readable thing

type Img

type Img struct {
	Width       int
	Height      int
	URLFragment string
	MimeType    string
}

Img describes image

type LangData

type LangData struct {
	Code          string // E - English | P - Polish
	Title         string
	InitialFormat string // the initial format, like epub
	Path          string // This should contain part of path ~/LibJWgo/publications should be skipped, and only /nwt/P/ should be given
}

LangData stores per-language data

type Languages

type Languages struct {
	Status    int `json:"status"` // 200 - OK
	Languages []struct {
		Symbol         string   `json:"symbol"`         // pl
		Langcode       string   `json:"langcode"`       // P <--- this is what you need (nwt_P)
		Name           string   `json:"name"`           // Polish
		VernacularName string   `json:"vernacularName"` // Polish
		AltSpellings   []string `json:"altSpellings"`   // Polish, polski
		Direction      string   `json:"direction"`      // ltr
		IsSignLanguage bool     `json:"isSignLanguage"`
		IsCounted      bool     `json:"IsCounted"`
		HasWebContent  bool     `json:"hasWebContent"`
	} `json:"languages"`
	LocalizedCount string `json:"localizedCount"` // How many languages do we have?
}

Languages response from site https://www.jw.org/en/languages/

type Publication

type Publication struct {
	Code     string // This is meant to store the codename of publication (for example 'nwt' is the Bible)
	Year     int
	Image    Img
	LangData *[]LangData
}

Publication holds all kind of information about a publication

type PublicationChapter

type PublicationChapter struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

PublicationChapter - stores info about chapters

type PublicationV2

type PublicationV2 struct {
	Title  string `json:"title"`
	Format string `json:"format"`
	Path   string `json:"path"` // keep part of path.
	URI    string `json:"uri"`
}

PublicationV2 stores data only for specific publication (nwt_P instead of nwt)

Jump to

Keyboard shortcuts

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