Documentation ¶
Index ¶
Constants ¶
View Source
const APIURL = "https://www.dccomics.com"
APIURL is the base url for the API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { CharacterEndpoint string // Define the characters endpoint. maybe remove and find more elegant solution for testing. // contains filtered or unexported fields }
API is the client to communicate with the DC API.
func (*API) Characters ¶
Characters gets all the characters.
func (*API) TotalCharacters ¶
TotalCharacters gets the number of characters from the result.
type APIResult ¶
type APIResult struct { TotalResults int `json:"result count"` Results map[string]*CharacterResult }
APIResult contains the result of the API.
type CharacterFields ¶
type CharacterFields struct { Body []string `json:"body:value"` ProfilePicture []string `json:"field_profile_picture:file:url"` Name string `json:"dc_solr_sortable_title"` URL string `json:"url"` }
CharacterFields represent the fields for a character.
type CharacterResult ¶
type CharacterResult struct { ID string `json:"id"` Fields CharacterFields `json:"fields"` }
CharacterResult represents the result of each character.
Click to show internal directories.
Click to hide internal directories.