imma call it a night
This commit is contained in:
@@ -12,6 +12,7 @@ The best thing to happen since yesturday at 3 pm
|
|||||||
|
|
||||||
| Version | Changes |
|
| Version | Changes |
|
||||||
|-----------|----------------------|
|
|-----------|----------------------|
|
||||||
|
| 0.3 | it works as i want it to now (i think) now its time for a shiton of trubleshooting (yay!) |
|
||||||
| 0.2 | split the project into multiple files to make it more readable |
|
| 0.2 | split the project into multiple files to make it more readable |
|
||||||
| 0.1.1-7 | fixing the json print output to actualy print out all the data and sutch |
|
| 0.1.1-7 | fixing the json print output to actualy print out all the data and sutch |
|
||||||
| 0.1 | literaly most of the project |
|
| 0.1 | literaly most of the project |
|
||||||
|
|||||||
11
config/db.go
11
config/db.go
@@ -48,10 +48,9 @@ func PrintDBConfig() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Configuration:", config)
|
//fmt.Println("Configuration:", config)
|
||||||
fmt.Println("Host:", config.Database.Host)
|
//fmt.Println("Host:", config.Database.Host)
|
||||||
fmt.Println("Port:", config.Database.Port)
|
//fmt.Println("Port:", config.Database.Port)
|
||||||
fmt.Println("User:", config.Database.User)
|
fmt.Println("Database User:", config.Database.User)
|
||||||
fmt.Println("Database Host:", config.Database.Host)
|
//fmt.Println("Database Password:", config.Database.Password)
|
||||||
fmt.Println("Database Password:", config.Database.Password)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ func FetchData() (*Data, error) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := client.Get("https://api.entur.io/realtime/v1/rest/et?useOriginalId=true&maxSize=10")
|
resp, err := client.Get("https://api.entur.io/realtime/v1/rest/et?useOriginalId=true&maxSize=100000&requestorId=ti1ASDASDDAAWdfs")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func InsertOrUpdateEstimatedCall(db *sql.DB, values []interface{}) (int, string,
|
|||||||
var id int
|
var id int
|
||||||
err = stmt.QueryRow(values...).Scan(&action, &id)
|
err = stmt.QueryRow(values...).Scan(&action, &id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if 1 == 0 {
|
if 1 == 1 {
|
||||||
fmt.Println("Executing query:", query)
|
fmt.Println("Executing query:", query)
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
fmt.Printf("Value %d: (%v)\n", i+1, v)
|
fmt.Printf("Value %d: (%v)\n", i+1, v)
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ func DBData(data *data.Data) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error inserting/updating estimated vehicle journey: %v\n", err)
|
fmt.Printf("Error inserting/updating estimated vehicle journey: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Action: %s, ID: %d\n", action, id)
|
if 1 == 0 {
|
||||||
|
fmt.Printf("Action: %s, ID: %d\n", action, id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, estimatedCall := range journey.EstimatedCalls {
|
for _, estimatedCall := range journey.EstimatedCalls {
|
||||||
for _, call := range estimatedCall.EstimatedCall {
|
for _, call := range estimatedCall.EstimatedCall {
|
||||||
@@ -266,7 +268,9 @@ func DBData(data *data.Data) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error inserting/updating estimated call: %v\n", err)
|
fmt.Printf("Error inserting/updating estimated call: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Action: %s, ID: %d\n", action, id)
|
if 1 == 0 {
|
||||||
|
fmt.Printf("Action: %s, ID: %d\n", action, id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user