Documentation ¶
Overview ¶
fbi is a Go client for the FBI's Most Wanted REST API 🚔
Installation
go get -u github.com/brittonhayes/fbi
Usage
func main() { // Initialize fugitives f := new(fbi.Fugitives) // List the fugitives err := f.List() if err != nil { // handle error panic(err) } // Print raw results fmt.Println(f) // Print specific items from the list of results fmt.Println(f.Items[0]) }
Pretty Print Results
func main() { // Initialize fugitives f := new(fbi.Fugitives) // List the fugitives as pretty-printed json j, err := f.ListPretty() if err != nil { panic(err) } // Print out the results fmt.Println(string(j)) }
Reference ¶
Source API: https://api.fbi.gov/wanted/v1/list
Index ¶
Constants ¶
const (
BaseURL = "https://api.fbi.gov/wanted/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
Downloader allows locally downloading the remote files and images from their URLs
type Fugitives ¶
type Fugitives struct { Total int `json:"total"` Items []Individual `json:"items"` }
Fugitives is the base structure for the FBI most wanted REST API response and contains a list of individuals as well as the total items found
func (*Fugitives) ListPretty ¶
ListPretty lists all fugitives from the Most Wanted API and then auto formats results as pretty-printed JSON
type Images ¶
type Images struct { Large string `json:"large"` Caption interface{} `json:"caption"` Original string `json:"original"` Thumb string `json:"thumb"` }
Images are the pictures available of the individual
type Individual ¶
type Individual struct { Images []Images `json:"images"` Occupations interface{} `json:"occupations"` DatesOfBirthUsed interface{} `json:"dates_of_birth_used"` WeightMax interface{} `json:"weight_max"` AgeMax interface{} `json:"age_max"` AgeRange interface{} `json:"age_range"` AdditionalInformation interface{} `json:"additional_information"` WeightMin interface{} `json:"weight_min"` RewardText string `json:"reward_text"` Aliases interface{} `json:"aliases"` UID string `json:"uid"` HairRaw interface{} `json:"hair_raw"` Race interface{} `json:"race"` RaceRaw interface{} `json:"race_raw"` Eyes interface{} `json:"eyes"` Hair interface{} `json:"hair"` Sex interface{} `json:"sex"` Languages interface{} `json:"languages"` WarningMessage interface{} `json:"warning_message"` PossibleCountries interface{} `json:"possible_countries"` Remarks interface{} `json:"remarks"` Build interface{} `json:"build"` HeightMin interface{} `json:"height_min"` Suspects interface{} `json:"suspects"` Publication string `json:"publication"` Status string `json:"status"` Subjects []string `json:"subjects"` Title string `json:"title"` ScarsAndMarks interface{} `json:"scars_and_marks"` Path string `json:"path"` PossibleStates interface{} `json:"possible_states"` Nationality interface{} `json:"nationality"` Files []Files `json:"files"` Coordinates []interface{} `json:"coordinates"` PersonClassification string `json:"person_classification"` Description string `json:"description"` PlaceOfBirth interface{} `json:"place_of_birth"` HeightMax interface{} `json:"height_max"` Locations interface{} `json:"locations"` Caution interface{} `json:"caution"` EyesRaw interface{} `json:"eyes_raw"` Ncic interface{} `json:"ncic"` LegatNames interface{} `json:"legat_names"` Complexion interface{} `json:"complexion"` FieldOffices []string `json:"field_offices"` RewardMin int `json:"reward_min"` RewardMax int `json:"reward_max"` AgeMin interface{} `json:"age_min"` URL string `json:"url"` Details string `json:"details"` Modified time.Time `json:"modified"` Weight interface{} `json:"weight"` ID string `json:"@id"` }
Individual represents a single person in the FBI most wanted list
type Options ¶
type Options struct { Title string `url:"title"` FieldOffices string `url:"field_offices"` Status string `url:"status"` PersonClassification string `url:"person_classification"` Page int `url:"page"` Limit int `url:"pageSize"` SortOn string `url:"sort_on"` SortOrder string `url:"sort_order"` }
Options contains the available query params for filter API request results