Skip to content
Snippets Groups Projects
Commit e6ffe068 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improved json serialization

parent 02e15d12
Branches
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ type HafasMessage struct { ...@@ -12,7 +12,7 @@ type HafasMessage struct {
type HafasMessagePriority string type HafasMessagePriority string
const ( const (
HafasMessagePriorityLow HafasMessagePriority = "LOW"
HafasMessagePriorityMiddle HafasMessagePriority = "MIDDLE"
HafasMessagePriorityHigh HafasMessagePriority = "HIGH" HafasMessagePriorityHigh HafasMessagePriority = "HIGH"
HafasMessagePriorityMiddle HafasMessagePriority = "MEDIUM"
HafasMessagePriorityLow HafasMessagePriority = "LOW"
) )
...@@ -8,6 +8,6 @@ type Station struct { ...@@ -8,6 +8,6 @@ type Station struct {
StationName string `json:"station_name,omitempty"yaml:"station_name,omitempty"` StationName string `json:"station_name,omitempty"yaml:"station_name,omitempty"`
EvaId string `json:"eva_id,omitempty"yaml:"eva_id,omitempty"` EvaId string `json:"eva_id,omitempty"yaml:"eva_id,omitempty"`
StationCode string `json:"station_code,omitempty"yaml:"station_code,omitempty"` StationCode string `json:"station_code,omitempty"yaml:"station_code,omitempty"`
Db bool `json:"db"yaml:"db"` Db bool `json:"db,omitempty"yaml:"db,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"yaml:"created_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"yaml:"created_at,omitempty"`
} }
...@@ -3,14 +3,14 @@ package bahn ...@@ -3,14 +3,14 @@ package bahn
import "time" import "time"
type Suggestion struct { type Suggestion struct {
Value string Value string `json:"value,omitempty"yaml:"value,omitempty"`
Cycle string Cycle string `json:"cycle,omitempty"yaml:"cycle,omitempty"`
Pool string Pool string `json:"pool,omitempty"yaml:"pool,omitempty"`
Id string Id string `json:"id,omitempty"yaml:"id,omitempty"`
TrainLink string TrainLink string `json:"train_link,omitempty"yaml:"train_link,omitempty"`
PublishedTime *time.Time PublishedTime *time.Time `json:"published_time,omitempty"yaml:"published_time,omitempty"`
DepartureStation string DepartureStation string `json:"departure_station,omitempty"yaml:"departure_station,omitempty"`
DepartureTime *time.Time DepartureTime *time.Time `json:"departure_time,omitempty"yaml:"departure_time,omitempty"`
ArrivalStation string ArrivalStation string `json:"arrival_station,omitempty"yaml:"arrival_station,omitempty"`
ArrivalTime *time.Time ArrivalTime *time.Time `json:"arrival_time,omitempty"yaml:"arrival_time,omitempty"`
} }
...@@ -9,5 +9,5 @@ type WingDefinitionElement struct { ...@@ -9,5 +9,5 @@ type WingDefinitionElement struct {
EvaId string `json:"eva_id,omitempty"yaml:"eva_id,omitempty"` EvaId string `json:"eva_id,omitempty"yaml:"eva_id,omitempty"`
StationName string `json:"station_name,omitempty"yaml:"station_name,omitempty"` StationName string `json:"station_name,omitempty"yaml:"station_name,omitempty"`
PlannedTime string `json:"planned_time,omitempty"yaml:"planned_time,omitempty"` PlannedTime string `json:"planned_time,omitempty"yaml:"planned_time,omitempty"`
Fl bool `json:"fl"yaml:"fl"` Fl bool `json:"fl,omitempty"yaml:"fl,omitempty"`
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment