Browse Source

Added struct for the json data

Signed-off-by: Blagovest Petrov <blagovest@petrovs.info>
master
Blagovest Petrov 8 months ago
parent
commit
0ea6943a75
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      fetch_data.go

+ 12
- 2
fetch_data.go View File

@ -1,12 +1,19 @@
package main
import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"crypto/tls"
)
type ParkingStatus []struct {
ParkingID int
Time string
FreePlaces string
}
func fetch_data() string {
url := "https://213.240.235.145/web-site-service/rest/parkingBoardsRequest/allFreePlaces"
@ -24,11 +31,14 @@ func fetch_data() string {
panic(err)
}
// fmt.Printf("%s\n", traffic_data)
return string(traffic_rawdata)
}
// func parse_data () string {
// }
func main() {
fmt.Printf("%s\n", fetch_data())
}
}

Loading…
Cancel
Save