metadata

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init client for elasticsearch

Types

type Job

type Job struct {
	WaveID      string
	StartAt     time.Time
	TimeProcess time.Duration
	Station     traincat.Station
	Error       string
}

Job represent data around one job

func (Job) MarshalJSON

func (j Job) MarshalJSON() ([]byte, error)

MarshalJSON return good formatted json for ElasticSearch

func (Job) Persist

func (j Job) Persist()

Persist metadata to ElasticSearch

type Realtime

type Realtime struct {
	WaveID    string
	CheckedAt time.Time
	State     string
	Schedule  time.Time
	Station   traincat.Station
	Train     Train
	PassageID string
}

Realtime represent all data around one passage from SNCF API

func (*Realtime) MarshalJSON

func (r *Realtime) MarshalJSON() ([]byte, error)

MarshalJSON return good formatted json for ElasticSearch

func (*Realtime) Persist

func (r *Realtime) Persist()

Persist metadata to ElasticSearch

type Request

type Request struct {
	WaveID       string
	ResponseTime time.Duration
	Station      traincat.Station
	CountPassage int
	StatusCode   int
	SendAt       time.Time
	ResponseBody string
	Error        string
}

Request represent all data around one request send to the SNCF API

func (Request) MarshalJSON

func (r Request) MarshalJSON() ([]byte, error)

MarshalJSON return good formatted json for ElasticSearch

func (Request) Persist

func (r Request) Persist()

Persist metadata to ElasticSearch

type Train

type Train struct {
	Code    string `json:"code"`
	Mission string `json:"mission"`
}

Train is struct for push to ElasticSearch

type Wave

type Wave struct {
	UUID        string
	TimeProcess time.Duration
	LaunchedAt  time.Time
}

Wave represent all data around one wave of call to SNCF API

func (Wave) MarshalJSON

func (w Wave) MarshalJSON() ([]byte, error)

MarshalJSON return good formatted json for ElasticSearch

func (Wave) Persist

func (w Wave) Persist()

Persist meta to ElasticSearch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL