Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Issue ¶
type Issue struct { State string `json:"state"` Code string `json:"code"` Schedule string `json:"schedule"` StationID int `json:"station_id"` StationName string `json:"station_name"` }
Issue include in pubsub message
func GetIssueFromHTTPRequest ¶
GetIssueFromHTTPRequest return Issue or error if they can't decode PubSubMessage
func (*Issue) ToEntity ¶
func (i *Issue) ToEntity() (*IssueEntity, error)
ToEntity transform pub/sub issue to the IssueEntity
type IssueEntity ¶
type IssueEntity struct { gorm.Model Schedule int64 `gorm:"column:schedule"` StationID int `gorm:"column:station_id"` State string `gorm:"column:state"` CodeTrain string `gorm:"column:code_train"` }
IssueEntity structure for database
type PubSubMessage ¶
type PubSubMessage struct { Message struct { Data string `json:"data"` } `json:"message"` }
PubSubMessage receive from pub/sub
func GetPubSubMessageFromHTTPRequest ¶
func GetPubSubMessageFromHTTPRequest(r *http.Request) (*PubSubMessage, error)
GetPubSubMessageFromHTTPRequest return PubSubMessage or error if they can't decode request body
func (PubSubMessage) GetIssue ¶
func (m PubSubMessage) GetIssue() (*Issue, error)
GetIssue decode base64 content of PubSubMessage
Click to show internal directories.
Click to hide internal directories.