Add support for 'Update' transaction type
This commit is contained in:
parent
5cbc6aef9b
commit
0aa77f2a21
@ -10,12 +10,16 @@ import (
|
||||
// Decide, based on the DB Formatted message type, what action needs taking
|
||||
// then either insert, or delete from the database as required
|
||||
func processEntryType(entry database.Service) {
|
||||
if entry.TransactionType == "Create" {
|
||||
|
||||
switch entry.TransactionType {
|
||||
case "Create":
|
||||
createEntry(entry)
|
||||
} else if entry.TransactionType == "Delete" {
|
||||
case "Update":
|
||||
updateEntry(entry)
|
||||
case "Delete":
|
||||
deleteEntry(entry)
|
||||
} else {
|
||||
log.Msg.Error("Unknown TransactionType: " + entry.TransactionType)
|
||||
default:
|
||||
log.Msg.Error("Unknown transaction type: " + entry.TransactionType)
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +27,10 @@ func createEntry(entry database.Service) {
|
||||
log.Msg.Info("Entry Creation requested for: " + entry.TrainUid + " - " + entry.Headcode + " - " + entry.Operator)
|
||||
}
|
||||
|
||||
func updateEntry(entry database.Service) {
|
||||
log.Msg.Info("Entry UPDATE requested for: " + entry.TrainUid + " - " + entry.Headcode + " - " + entry.Operator)
|
||||
}
|
||||
|
||||
func deleteEntry(entry database.Service) {
|
||||
log.Msg.Info("Entry DELETE requested for: " + entry.TrainUid + " - " + entry.Headcode)
|
||||
fmt.Printf("%+v\n", entry)
|
||||
|
Loading…
Reference in New Issue
Block a user