Remove unused API method
This commit is contained in:
parent
c8133803f7
commit
e5b87bb8ae
|
@ -10,31 +10,6 @@ import (
|
||||||
|
|
||||||
var BULK_DATA_URI = "https://api.scryfall.com/bulk-data"
|
var BULK_DATA_URI = "https://api.scryfall.com/bulk-data"
|
||||||
|
|
||||||
func GetBulkData() (types.BulkDataList, error) {
|
|
||||||
response, err := http.Get(BULK_DATA_URI)
|
|
||||||
if err != nil {
|
|
||||||
return types.BulkDataList{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if response.StatusCode != http.StatusOK {
|
|
||||||
return types.BulkDataList{}, errors.New("HTTP request failed with code: " + string(response.StatusCode))
|
|
||||||
}
|
|
||||||
|
|
||||||
defer response.Body.Close()
|
|
||||||
bulkDataBytes, err := io.ReadAll(response.Body)
|
|
||||||
if err != nil {
|
|
||||||
return types.BulkDataList{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var bulkDataList types.BulkDataList
|
|
||||||
err = json.Unmarshal(bulkDataBytes, &bulkDataList)
|
|
||||||
if err != nil {
|
|
||||||
return types.BulkDataList{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return bulkDataList, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetBulkDataByType(bulkDataType string) (types.BulkData, error) {
|
func GetBulkDataByType(bulkDataType string) (types.BulkData, error) {
|
||||||
response, err := http.Get(BULK_DATA_URI + "/" + bulkDataType)
|
response, err := http.Get(BULK_DATA_URI + "/" + bulkDataType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue