freaking-dell speciaal

This commit is contained in:
Valentijn van der Jagt
2026-03-10 08:33:37 +01:00
parent d296e21220
commit 6fa9ba0057

34
main.go
View File

@@ -11,6 +11,9 @@ In this project i play around with go. This is my first time writing go, and im
// https://stackoverflow.com/questions/16466320/is-there-a-way-to-do-repetitive-tasks-at-intervals, How timer intervals work in GoLang // https://stackoverflow.com/questions/16466320/is-there-a-way-to-do-repetitive-tasks-at-intervals, How timer intervals work in GoLang
// https://pkg.go.dev/modernc.org/sqlite#section-documentation, how to interface with specifically sqlite in GoLang // https://pkg.go.dev/modernc.org/sqlite#section-documentation, how to interface with specifically sqlite in GoLang
// https://github.com/mattn/go-sqlite3/blob/v1.14.34/_example/simple/simple.go, How to inferface with a database in GoLang. // https://github.com/mattn/go-sqlite3/blob/v1.14.34/_example/simple/simple.go, How to inferface with a database in GoLang.
// https://go.dev/tour/moretypes/6, arrays....
// https://go.dev/doc/tutorial/handle-errors, deal with returning errors
import ( import (
"database/sql" "database/sql"
"log" "log"
@@ -30,7 +33,36 @@ func findParcelProvider(code string, postal_code string)(string, error){
return v, nil return v, nil
} }
} }
return "", errors.New("parcel not found!") return "", errors.New("Parcel not found in the common providers!")
}
func markPackageSubscription(code string, postal_code string, service string){
/*
{
"type": "Shipment",
"format": "Default",
"service": "parcel-nl",
"hook": {
"uri": "https://your-server.example.com/dhl-webhook"
},
"events": [
"pre-transit",
"transit",
"delivered",
"failure",
"unknown"
],
"shipmentIDsWithChallengeDetails": [
{
"shipmentID": "3SABCDEF123456",
"postalCode": "1012AB"
}
]
}
*/
} }