Add Values functions to flat structs to map them to []interface for clickhouse
This commit is contained in:
@@ -6,9 +6,35 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ===============================================
|
||||
// CONVERSION FUNCTIONS
|
||||
// ===============================================
|
||||
// Values returns all fields in the order expected by ClickHouse INSERT
|
||||
func (fk *FlatKillmail) Values() []interface{} {
|
||||
return []interface{}{
|
||||
fk.KillmailID,
|
||||
fk.KillmailTime,
|
||||
fk.SolarSystemID,
|
||||
fk.KillmailHash,
|
||||
fk.VictimShipTypeID,
|
||||
fk.VictimCharacterID,
|
||||
fk.VictimCorporationID,
|
||||
fk.VictimAllianceID,
|
||||
fk.VictimDamageTaken,
|
||||
fk.VictimPosX,
|
||||
fk.VictimPosY,
|
||||
fk.VictimPosZ,
|
||||
fk.AttackerCount,
|
||||
fk.TotalDamageDone,
|
||||
fk.FinalBlowShipType,
|
||||
fk.Attackers,
|
||||
fk.Items,
|
||||
}
|
||||
}
|
||||
func (fm *FlatModule) Values() []interface{} {
|
||||
return []interface{}{
|
||||
fm.KillmailID,
|
||||
fm.ItemTypeID,
|
||||
string(fm.Slot),
|
||||
}
|
||||
}
|
||||
|
||||
// FlattenKillmail converts the nested JSON structure to ClickHouse format
|
||||
func (k *Killmail) FlattenKillmail() (*FlatKillmail, []*FlatModule) {
|
||||
|
||||
Reference in New Issue
Block a user