model

package
v0.0.0-...-9a670f3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STOP_AREA       = "stop_area"
	STOP_AREA_GROUP = "stop_area_group"
	LINE            = "line"
	LINE_GROUP      = "line_group"
	VEHICLE_JOURNEY = "vehicle_journey"
	STOP_VISIT      = "stop_visit"
	OPERATOR        = "operator"
	TOTAL_INSERTS   = "Total"
	ERRORS          = "Errors"
)
CSV Structure

operator,Id,ModelName,Name,Codes stop_area,Id,ParentId,ReferentId,ModelName,Name,Codes,LineIds,Attributes,References,CollectedAlways,CollectChildren,CollectSituations line,Id,ModelName,Name,Codes,Attributes,References,CollectSituations vehicle_journey,Id,ModelName,Name,Codes,LineId,OriginName,DestinationName,Attributes,References,DirectionType, Number stop_visit,Id,ModelName,Codes,StopAreaId,VehicleJourneyId,PassageOrder,Schedules,Attributes,References stop_area_group,Id,ModelName,Name,ShortName,StopAreaIds line_group,Id,ModelName,Name,ShortName,LineIds

Comments are '#' Separators are ',' leading spaces are trimed

Escape quotes with another quote ex: "[""1234"",""5678""]"

View Source
const (
	IfAttribute               = "IfAttribute"
	SetAttribute              = "SetAttribute"
	DefineAimedScheduledTimes = "DefineAimedScheduledTimes"
	DefineSituationAffects    = "DefineSituationAffects"
)
View Source
const (
	// Warning: Hooks needs to be sorted
	AfterCreate hook = iota
	AfterSave
)
View Source
const (
	Undefined               = ""
	Unknown                 = "unknown"
	Empty                   = "empty"
	ManySeatsAvailable      = "manySeatsAvailable"
	FewSeatsAvailable       = "fewSeatsAvailable"
	StandingRoomOnly        = "standingRoomOnly"
	CrushedStandingRoomOnly = "crushedStandingRoomOnly"
	Full                    = "full"
	NotAcceptingPassengers  = "notAcceptingPassengers"
	StandingAvailable       = "standingAvailable"
	SeatsAvailable          = "seatsAvailable"
)
View Source
const (
	SituationReportTypeGeneral  ReportType    = "general"
	SituationReportTypeIncident ReportType    = "incident"
	SituationTypeLine           SituationType = "Line"
	SituationTypeStopArea       SituationType = "StopArea"
	SituationTypeAllLines       SituationType = "AllLines"
)
View Source
const (
	VEHICLE_DIRECTION_INBOUND  = "inbound"
	VEHICLE_DIRECTION_OUTBOUND = "outbound"
)
View Source
const (
	Default = "_default"
)

Variables

View Source
var Database *gorp.DbMap

Functions

func AffectFromProto

func AffectFromProto(value interface{}, remoteCodeSpace string, m Model) (Affect, *AffectRefs, error)

func ApplyMigrations

func ApplyMigrations(operation, path string, database *sql.DB) error

func CleanTestDb

func CleanTestDb(t *testing.T)

func CloseDB

func CloseDB(database *gorp.DbMap)

func InitDB

func InitDB(config config.DatabaseConfig) *gorp.DbMap

func InitTestDb

func InitTestDb(t *testing.T)

func IsContext

func IsContext(c string) bool

func IsUpdater

func IsUpdater(u string) bool

func LoadFromCSVFile

func LoadFromCSVFile(filePath string, referentialSlug string, force bool) error

func NewContexFromDatabase

func NewContexFromDatabase(sm *SelectMacro) (context, error)

func NewDefineSituationAffectsUpdater

func NewDefineSituationAffectsUpdater(sm *SelectMacro) (updater, error)

func NewStopVisitDefineAimedScheduledTimesUpdater

func NewStopVisitDefineAimedScheduledTimesUpdater(sm *SelectMacro) (updater, error)

func NewUpdateManager

func NewUpdateManager(model Model) func(UpdateEvent)

func NewUpdaterFromDatabase

func NewUpdaterFromDatabase(sm *SelectMacro) (updater, error)

func NewVehicleJourneyIfAttributeContext

func NewVehicleJourneyIfAttributeContext(sm *SelectMacro) (context, error)

func NewVehicleJourneySetAttributeUpdater

func NewVehicleJourneySetAttributeUpdater(sm *SelectMacro) (updater, error)

func NormalizedOccupancyName

func NormalizedOccupancyName(occupancy string) string

Types

type APISituation

type APISituation struct {
	Id     SituationId `json:",omitempty"`
	Origin string      `json:",omitempty"`
	CodeConsumer

	CodeSpace             string    `json:",omitempty"`
	SituationNumber       string    `json:",omitempty"`
	ExistingSituationCode bool      `json:"-"`
	RecordedAt            time.Time `json:",omitempty"`
	Version               int       `json:",omitempty"`

	VersionedAt        time.Time    `json:",omitempty"`
	ValidityPeriods    []*TimeRange `json:",omitempty"`
	PublicationWindows []*TimeRange `json:",omitempty"`

	Progress       SituationProgress   `json:",omitempty"`
	Severity       SituationSeverity   `json:",omitempty"`
	Reality        SituationReality    `json:",omitempty"`
	Keywords       []string            `json:",omitempty"`
	ReportType     ReportType          `json:",omitempty"`
	AlertCause     SituationAlertCause `json:",omitempty"`
	ProducerRef    string              `json:",omitempty"`
	Format         string              `json:",omitempty"`
	InternalTags   []string            `json:",omitempty"`
	ParticipantRef string              `json:",omitempty"`
	Summary        *TranslatedString   `json:",omitempty"`
	Description    *TranslatedString   `json:",omitempty"`

	Affects                 Affects                   `json:",omitempty"`
	Consequences            []*Consequence            `json:",omitempty"`
	PublishToWebActions     []*PublishToWebAction     `json:",omitempty"`
	PublishToMobileActions  []*PublishToMobileAction  `json:",omitempty"`
	PublishToDisplayActions []*PublishToDisplayAction `json:",omitempty"`
	InfoLinks               []*InfoLink               `json:",omitempty"`

	Errors e.Errors `json:"Errors,omitempty"`

	IgnoreValidation bool `json:",omitempty"`
}

func (*APISituation) MarshalJSON

func (apiSituation *APISituation) MarshalJSON() ([]byte, error)

func (*APISituation) UnmarshalJSON

func (situation *APISituation) UnmarshalJSON(data []byte) error

func (*APISituation) Validate

func (apiSituation *APISituation) Validate() bool

type ActionCommon

type ActionCommon struct {
	Name               string                `json:",omitempty"`
	ActionType         string                `json:",omitempty"`
	Value              string                `json:",omitempty"`
	Prompt             *TranslatedString     `json:",omitempty"`
	ScopeType          SituationScopeType    `json:",omitempty"`
	Affects            Affects               `json:",omitempty"`
	ActionStatus       SituationActionStatus `json:",omitempty"`
	Description        *TranslatedString     `json:",omitempty"`
	PublicationWindows []*TimeRange          `json:",omitempty"`
}

type ActionData

type ActionData struct {
	Name       string            `json:",omitempty"`
	ActionType string            `json:",omitempty"`
	Value      string            `json:",omitempty"`
	Prompt     *TranslatedString `json:",omitempty"`
}

type Affect

type Affect interface {
	GetType() SituationType
	GetId() ModelId
}

SubTypes of Affect

type AffectRefs

type AffectRefs struct {
	MonitoringRefs map[string]struct{}
	LineRefs       map[string]struct{}
}

func AffectToProto

func AffectToProto(a Affect, remoteCodeSpace string, m Model) ([]*gtfs.EntitySelector, *AffectRefs, error)

type AffectedAllLines

type AffectedAllLines struct{}

func NewAffectedAllLines

func NewAffectedAllLines() *AffectedAllLines

func (AffectedAllLines) GetId

func (a AffectedAllLines) GetId() ModelId

func (AffectedAllLines) GetType

func (a AffectedAllLines) GetType() SituationType

func (AffectedAllLines) MarshalJSON

func (affect AffectedAllLines) MarshalJSON() ([]byte, error)

type AffectedDestination

type AffectedDestination struct {
	StopAreaId StopAreaId
}

type AffectedLine

type AffectedLine struct {
	LineId               LineId                 `json:",omitempty"`
	AffectedDestinations []*AffectedDestination `json:",omitempty"`
	AffectedSections     []*AffectedSection     `json:",omitempty"`
	AffectedRoutes       []*AffectedRoute       `json:",omitempty"`
}

func NewAffectedLine

func NewAffectedLine() *AffectedLine

func (AffectedLine) GetId

func (a AffectedLine) GetId() ModelId

func (AffectedLine) GetType

func (a AffectedLine) GetType() SituationType

func (AffectedLine) MarshalJSON

func (affect AffectedLine) MarshalJSON() ([]byte, error)

type AffectedRoute

type AffectedRoute struct {
	RouteRef    string       `json:",omitempty"`
	StopAreaIds []StopAreaId `json:",omitempty"`
}

type AffectedSection

type AffectedSection struct {
	FirstStop StopAreaId
	LastStop  StopAreaId
}

type AffectedStopArea

type AffectedStopArea struct {
	StopAreaId StopAreaId `json:",omitempty"`
	LineIds    []LineId   `json:",omitempty"`
}

func NewAffectedStopArea

func NewAffectedStopArea() *AffectedStopArea

func (AffectedStopArea) GetId

func (a AffectedStopArea) GetId() ModelId

func (AffectedStopArea) GetType

func (a AffectedStopArea) GetType() SituationType

func (AffectedStopArea) MarshalJSON

func (affect AffectedStopArea) MarshalJSON() ([]byte, error)

type Affects

type Affects []Affect

func (*Affects) UnmarshalJSON

func (affects *Affects) UnmarshalJSON(data []byte) error

type Attributes

type Attributes map[string]string

func NewAttributes

func NewAttributes() Attributes

func (Attributes) Copy

func (attributes Attributes) Copy() (c Attributes)

func (Attributes) IsEmpty

func (attributes Attributes) IsEmpty() bool

func (Attributes) Set

func (attributes Attributes) Set(key string, value string)

type Blocking

type Blocking struct {
	JourneyPlanner bool
	RealTime       bool
}

type ByTime

type ByTime []*StopVisit

func (ByTime) Len

func (a ByTime) Len() int

func (ByTime) Less

func (a ByTime) Less(i, j int) bool

func (ByTime) Swap

func (a ByTime) Swap(i, j int)

type Code

type Code struct {
	// contains filtered or unexported fields
}

func NewCode

func NewCode(codeSpace, value string) Code

func (Code) CodeSpace

func (code Code) CodeSpace() string

func (Code) HashValue

func (code Code) HashValue() string

func (Code) IsEmpty

func (code Code) IsEmpty() bool

func (*Code) MarshalJSON

func (code *Code) MarshalJSON() ([]byte, error)

func (*Code) SetValue

func (code *Code) SetValue(toset string)

func (Code) String

func (code Code) String() string

func (*Code) UnmarshalJSON

func (code *Code) UnmarshalJSON(data []byte) error

func (Code) Value

func (code Code) Value() string

type CodeConsumer

type CodeConsumer struct {
	// contains filtered or unexported fields
}

func (*CodeConsumer) Code

func (consumer *CodeConsumer) Code(codeSpace string) (Code, bool)

func (*CodeConsumer) CodeSlice

func (consumer *CodeConsumer) CodeSlice() (objs []string)

func (*CodeConsumer) CodeWithFallback

func (consumer *CodeConsumer) CodeWithFallback(codeSpaces []string) (Code, bool)

func (*CodeConsumer) Codes

func (consumer *CodeConsumer) Codes() Codes

func (*CodeConsumer) CodesResponse

func (consumer *CodeConsumer) CodesResponse() map[string]string

func (*CodeConsumer) Copy

func (consumer *CodeConsumer) Copy() (c CodeConsumer)

func (*CodeConsumer) SetCode

func (consumer *CodeConsumer) SetCode(code Code)

type CodeConsumerInterface

type CodeConsumerInterface interface {
	Code(string) (Code, bool)
	CodeWithFallback([]string) (Code, bool)
	Codes() Codes
	CodesResponse() map[string]string
	SetCode(Code)
	CodeSlice() []string
}

type CodeIndex

type CodeIndex struct {
	// contains filtered or unexported fields
}

func NewCodeIndex

func NewCodeIndex() *CodeIndex

func (*CodeIndex) Delete

func (index *CodeIndex) Delete(modelId ModelId)

func (*CodeIndex) Find

func (index *CodeIndex) Find(code Code) (ModelId, bool)

func (*CodeIndex) Index

func (index *CodeIndex) Index(model ModelInstance)

type Codes

type Codes map[string]Code

func NewCodesFromMap

func NewCodesFromMap(codeMap map[string]string) (codes Codes)

func (Codes) Empty

func (identifiers Codes) Empty() bool

func (Codes) MarshalJSON

func (identifiers Codes) MarshalJSON() ([]byte, error)

func (Codes) ToSlice

func (identifiers Codes) ToSlice() (objs []string)

func (Codes) UnmarshalJSON

func (identifiers Codes) UnmarshalJSON(text []byte) error

type Collectable

type Collectable struct {
	// contains filtered or unexported fields
}

func (*Collectable) CollectedAt

func (c *Collectable) CollectedAt() time.Time

func (*Collectable) NextCollect

func (c *Collectable) NextCollect(collectTime time.Time)

func (*Collectable) NextCollectAt

func (c *Collectable) NextCollectAt() time.Time

func (*Collectable) Updated

func (c *Collectable) Updated(updateTime time.Time)

type ComplexError

type ComplexError struct {
	Errors []string
}

func (*ComplexError) Add

func (c *ComplexError) Add(field string, err error)

func (ComplexError) Error

func (c ComplexError) Error() string

func (ComplexError) ErrorCount

func (c ComplexError) ErrorCount() int

type Consequence

type Consequence struct {
	Periods   []*TimeRange       `json:",omitempty"`
	Condition SituationCondition `json:",omitempty"`
	Severity  SituationSeverity  `json:",omitempty"`
	Affects   Affects            `json:",omitempty"`
	Blocking  *Blocking          `json:",omitempty"`
}

type DatabaseLine

type DatabaseLine struct {
	Id                string         `db:"id"`
	ReferentialSlug   string         `db:"referential_slug"`
	ModelName         string         `db:"model_name"`
	Name              string         `db:"name"`
	Codes             string         `db:"codes"`
	Attributes        string         `db:"attributes"`
	References        string         `db:"siri_references"`
	ReferentId        sql.NullString `db:"referent_id"`
	CollectSituations bool           `db:"collect_situations"`
}

type DatabaseLineGroup

type DatabaseLineGroup struct {
	Id              string `db:"id"`
	ReferentialSlug string `db:"referential_slug"`
	ModelName       string `db:"model_name"`
	Name            string `db:"name"`
	ShortName       string `db:"short_name"`
	LineIds         string `db:"line_ids"`
}

type DatabaseOperator

type DatabaseOperator struct {
	Id              string `db:"id"`
	ReferentialSlug string `db:"referential_slug"`
	Name            string `db:"name"`
	Codes           string `db:"codes"`
	ModelName       string `db:"model_name"`
}

type DatabasePartner

type DatabasePartner struct {
	Id             string `db:"id"`
	ReferentialId  string `db:"referential_id"`
	Slug           string `db:"slug"`
	Name           string `db:"name"`
	Settings       string `db:"settings"`
	ConnectorTypes string `db:"connector_types"`
}

type DatabaseReferential

type DatabaseReferential struct {
	ReferentialId  string         `db:"referential_id"`
	Slug           string         `db:"slug"`
	Name           string         `db:"name"`
	Settings       string         `db:"settings"`
	Tokens         string         `db:"tokens"`
	ImportTokens   string         `db:"import_tokens"`
	OrganisationId sql.NullString `db:"organisation_id"`
}

type DatabaseStopArea

type DatabaseStopArea struct {
	LineIds           string         `db:"line_ids"`
	ReferentialSlug   string         `db:"referential_slug"`
	References        string         `db:"siri_references"`
	Attributes        string         `db:"attributes"`
	ModelName         string         `db:"model_name"`
	Name              string         `db:"name"`
	Codes             string         `db:"codes"`
	Id                string         `db:"id"`
	ReferentId        sql.NullString `db:"referent_id"`
	ParentId          sql.NullString `db:"parent_id"`
	CollectedAlways   bool           `db:"collected_always"`
	CollectChildren   bool           `db:"collect_children"`
	CollectSituations bool           `db:"collect_situations"`
}

type DatabaseStopAreaGroup

type DatabaseStopAreaGroup struct {
	Id              string `db:"id"`
	ReferentialSlug string `db:"referential_slug"`
	ModelName       string `db:"model_name"`
	Name            string `db:"name"`
	ShortName       string `db:"short_name"`
	StopAreaIds     string `db:"stop_area_ids"`
}

type DatabaseStopVisit

type DatabaseStopVisit struct {
	Id               string
	ReferentialSlug  string `db:"referential_slug"`
	ModelName        string `db:"model_name"`
	Codes            string `db:"codes"`
	StopAreaId       string `db:"stop_area_id"`
	VehicleJourneyId string `db:"vehicle_journey_id"`
	Schedules        string `db:"schedules"`
	Attributes       string `db:"attributes"`
	References       string `db:"siri_references"`
	PassageOrder     int    `db:"passage_order"`
}

type DatabaseVehicleJourney

type DatabaseVehicleJourney struct {
	Id              string `db:"id"`
	ReferentialSlug string `db:"referential_slug"`
	ModelName       string `db:"model_name"`
	Name            string `db:"name"`
	Codes           string `db:"codes"`
	LineId          string `db:"line_id"`
	OriginName      string `db:"origin_name"`
	DestinationName string `db:"destination_name"`
	DirectionType   string `db:"direction_type"`
	Attributes      string `db:"attributes"`
	References      string `db:"siri_references"`
}

type Date

type Date struct {
	Year  int
	Month time.Month
	Day   int
}

func NewDate

func NewDate(reference time.Time) Date

func (*Date) String

func (date *Date) String() string

type DiffResult

type DiffResult struct {
	DiffMap map[string]interface{}
	Equal   bool
}

func Equal

func Equal(x, y interface{}) (*DiffResult, error)

type EventKind

type EventKind int
const (
	STOP_AREA_EVENT EventKind = iota
	STATUS_EVENT
	LINE_EVENT
	VEHICLE_JOURNEY_EVENT
	STOP_VISIT_EVENT
	NOT_COLLECTED_EVENT
	VEHICLE_EVENT
	SITUATION_EVENT
)

type Index

type Index struct {
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex(extractor IndexableExtractor) *Index

func (*Index) Delete

func (index *Index) Delete(modelId ModelId)

func (*Index) Find

func (index *Index) Find(indexable ModelId) ([]ModelId, bool)

func (*Index) Index

func (index *Index) Index(model ModelInstance)

func (*Index) IndexableLength

func (index *Index) IndexableLength(indexable ModelId) int

type IndexableExtractor

type IndexableExtractor func(ModelInstance) ModelId
type InfoLink struct {
	Uri         string
	Label       string
	ImageRef    string
	LinkContent string
}

type Line

type Line struct {
	Collectable

	References References
	CodeConsumer
	Attributes Attributes

	ReferentId LineId `json:",omitempty"`
	Name       string `json:",omitempty"`
	Number     string `json:",omitempty"`

	CollectSituations bool
	// contains filtered or unexported fields
}

func NewLine

func NewLine(model Model) *Line

func (*Line) Attribute

func (line *Line) Attribute(key string) (string, bool)

func (*Line) DiscoveryCode

func (line *Line) DiscoveryCode(codeSpace string) (Code, bool)

Returns true if we need to send the Line in a Discovery

We only send the Line if it has no referent with a correct codeSpace. If that's the case, we'll send the Referent instead

func (*Line) Id

func (line *Line) Id() LineId

func (*Line) MarshalJSON

func (line *Line) MarshalJSON() ([]byte, error)

func (*Line) Origin

func (line *Line) Origin() string

func (*Line) Reference

func (line *Line) Reference(key string) (Reference, bool)

func (*Line) Referent

func (line *Line) Referent() (*Line, bool)

func (*Line) ReferentOrSelfCode

func (line *Line) ReferentOrSelfCode(codeSpace string) (Code, bool)

func (*Line) Save

func (line *Line) Save() bool

func (*Line) SetOrigin

func (line *Line) SetOrigin(origin string)

func (*Line) UnmarshalJSON

func (line *Line) UnmarshalJSON(data []byte) error

type LineGroup

type LineGroup struct {
	Name      string   `json:",omitempty"`
	ShortName string   `json:",omitempty"`
	LineIds   []LineId `json:",omitempty"`
	// contains filtered or unexported fields
}

func NewLineGroup

func NewLineGroup(model Model) *LineGroup

func (*LineGroup) Id

func (lineGroup *LineGroup) Id() LineGroupId

func (*LineGroup) MarshalJSON

func (lineGroup *LineGroup) MarshalJSON() ([]byte, error)

func (*LineGroup) Save

func (lineGroup *LineGroup) Save() bool

type LineGroupId

type LineGroupId ModelId

type LineGroups

type LineGroups interface {
	uuid.UUIDInterface

	New() *LineGroup

	Find(LineGroupId) (*LineGroup, bool)
	FindByShortName(string) (*LineGroup, bool)
	FindAll() []*LineGroup
	Save(*LineGroup) bool
	Delete(*LineGroup) bool
}

type LineId

type LineId ModelId

type LineUpdateEvent

type LineUpdateEvent struct {
	Origin string

	Code Code
	Name string
}

func NewLineUpdateEvent

func NewLineUpdateEvent() *LineUpdateEvent

func (*LineUpdateEvent) EventKind

func (ue *LineUpdateEvent) EventKind() EventKind

type Lines

type Lines interface {
	uuid.UUIDInterface

	New() *Line
	Find(LineId) (*Line, bool)
	FindByCode(Code) (*Line, bool)
	FindAll() []*Line
	FindFamily(LineId) []LineId
	FindFamilyFromCode(Code) []LineId
	Save(*Line) bool
	Delete(*Line) bool
}

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(referentialSlug string, force, printErrors bool) *Loader

func (Loader) Load

func (loader Loader) Load(reader io.Reader) Result

type Macro

type Macro struct {
	// contains filtered or unexported fields
}

func NewMacro

func NewMacro() *Macro

func NewMacroWithContext

func NewMacroWithContext(c context) *Macro

func (*Macro) AddContext

func (m *Macro) AddContext(c context)

func (*Macro) AddUpdater

func (m *Macro) AddUpdater(u updater)

func (*Macro) Update

func (m *Macro) Update(mi ModelInstance) (ok bool, err error)

type MacroId

type MacroId string

type MacroManager

type MacroManager struct {
	// contains filtered or unexported fields
}

func NewMacroManager

func NewMacroManager() *MacroManager

func (MacroManager) GetMacros

func (mm MacroManager) GetMacros(h hook, t ModelType) (m []Macro)

If we ask for AfterCreate, we'll also get AfterSave Macros

func (*MacroManager) Load

func (manager *MacroManager) Load(referentialSlug string) error

func (*MacroManager) Reset

func (mm *MacroManager) Reset()

type Macros

type Macros interface {
	GetMacros(hook, ModelType) []Macro
}

type MemoryLineGroups

type MemoryLineGroups struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryLineGroups

func NewMemoryLineGroups() *MemoryLineGroups

func (*MemoryLineGroups) Delete

func (manager *MemoryLineGroups) Delete(lineGroup *LineGroup) bool

func (*MemoryLineGroups) Find

func (manager *MemoryLineGroups) Find(id LineGroupId) (*LineGroup, bool)

func (*MemoryLineGroups) FindAll

func (manager *MemoryLineGroups) FindAll() (lineGroups []*LineGroup)

func (*MemoryLineGroups) FindByShortName

func (manager *MemoryLineGroups) FindByShortName(shortName string) (*LineGroup, bool)

func (*MemoryLineGroups) Load

func (manager *MemoryLineGroups) Load(referentialSlug string) error

func (*MemoryLineGroups) New

func (manager *MemoryLineGroups) New() *LineGroup

func (*MemoryLineGroups) Save

func (manager *MemoryLineGroups) Save(lineGroup *LineGroup) bool

type MemoryLines

type MemoryLines struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryLines

func NewMemoryLines() *MemoryLines

func (*MemoryLines) Delete

func (manager *MemoryLines) Delete(line *Line) bool

func (*MemoryLines) Find

func (manager *MemoryLines) Find(id LineId) (*Line, bool)

func (*MemoryLines) FindAll

func (manager *MemoryLines) FindAll() (lines []*Line)

func (*MemoryLines) FindByCode

func (manager *MemoryLines) FindByCode(code Code) (*Line, bool)

func (*MemoryLines) FindByReferentId

func (manager *MemoryLines) FindByReferentId(id LineId) (lines []*Line)

func (*MemoryLines) FindFamily

func (manager *MemoryLines) FindFamily(lineId LineId) (lineIds []LineId)

func (*MemoryLines) FindFamilyFromCode

func (manager *MemoryLines) FindFamilyFromCode(code Code) (lineIds []LineId)

func (*MemoryLines) Load

func (manager *MemoryLines) Load(referentialSlug string) error

func (*MemoryLines) New

func (manager *MemoryLines) New() *Line

func (*MemoryLines) Save

func (manager *MemoryLines) Save(line *Line) bool

type MemoryModel

type MemoryModel struct {
	SMEventsChan chan StopMonitoringBroadcastEvent
	GMEventsChan chan SituationBroadcastEvent
	SXEventsChan chan SituationBroadcastEvent
	VeEventChan  chan VehicleBroadcastEvent
	// contains filtered or unexported fields
}

func NewMemoryModel

func NewMemoryModel(referential string) *MemoryModel

func NewTestMemoryModel

func NewTestMemoryModel(referential ...string) *MemoryModel

func (*MemoryModel) Date

func (model *MemoryModel) Date() Date

func (*MemoryModel) LineGroups

func (model *MemoryModel) LineGroups() LineGroups

func (*MemoryModel) Lines

func (model *MemoryModel) Lines() Lines

func (*MemoryModel) Load

func (model *MemoryModel) Load() error

func (*MemoryModel) Macros

func (model *MemoryModel) Macros() Macros

func (*MemoryModel) Operators

func (model *MemoryModel) Operators() Operators

func (*MemoryModel) Referential

func (model *MemoryModel) Referential() string

func (*MemoryModel) RefreshMacros

func (model *MemoryModel) RefreshMacros()

func (*MemoryModel) Reload

func (model *MemoryModel) Reload() *MemoryModel

func (*MemoryModel) ScheduledStopVisits

func (model *MemoryModel) ScheduledStopVisits() StopVisits

func (*MemoryModel) SetBroadcastGMChan

func (model *MemoryModel) SetBroadcastGMChan(broadcastGMEventChan chan SituationBroadcastEvent)

func (*MemoryModel) SetBroadcastSMChan

func (model *MemoryModel) SetBroadcastSMChan(broadcastSMEventChan chan StopMonitoringBroadcastEvent)

func (*MemoryModel) SetBroadcastSXChan

func (model *MemoryModel) SetBroadcastSXChan(broadcastSXEventChan chan SituationBroadcastEvent)

func (*MemoryModel) SetBroadcastVeChan

func (model *MemoryModel) SetBroadcastVeChan(broadcastVeEventChan chan VehicleBroadcastEvent)

func (*MemoryModel) SetReferential

func (model *MemoryModel) SetReferential(referential string)

func (*MemoryModel) Situations

func (model *MemoryModel) Situations() Situations

func (*MemoryModel) StopAreaGroups

func (model *MemoryModel) StopAreaGroups() StopAreaGroups

func (*MemoryModel) StopAreas

func (model *MemoryModel) StopAreas() StopAreas

func (*MemoryModel) StopVisits

func (model *MemoryModel) StopVisits() StopVisits

func (*MemoryModel) VehicleJourneys

func (model *MemoryModel) VehicleJourneys() VehicleJourneys

func (*MemoryModel) Vehicles

func (model *MemoryModel) Vehicles() Vehicles

type MemoryOperators

type MemoryOperators struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryOperators

func NewMemoryOperators() *MemoryOperators

func (*MemoryOperators) Delete

func (manager *MemoryOperators) Delete(operator *Operator) bool

func (*MemoryOperators) Find

func (manager *MemoryOperators) Find(id OperatorId) (*Operator, bool)

func (*MemoryOperators) FindAll

func (manager *MemoryOperators) FindAll() (operators []*Operator)

func (*MemoryOperators) FindByCode

func (manager *MemoryOperators) FindByCode(code Code) (*Operator, bool)

func (*MemoryOperators) Load

func (manager *MemoryOperators) Load(referentialSlug string) error

func (*MemoryOperators) New

func (manager *MemoryOperators) New() *Operator

func (*MemoryOperators) Save

func (manager *MemoryOperators) Save(operator *Operator) bool

type MemorySituations

type MemorySituations struct {
	uuid.UUIDConsumer

	GMbroadcastEvent func(event SituationBroadcastEvent)
	SXbroadcastEvent func(event SituationBroadcastEvent)
	// contains filtered or unexported fields
}

func NewMemorySituations

func NewMemorySituations() *MemorySituations

func (*MemorySituations) Delete

func (manager *MemorySituations) Delete(situation *Situation) bool

func (*MemorySituations) Find

func (manager *MemorySituations) Find(id SituationId) (Situation, bool)

func (*MemorySituations) FindAll

func (manager *MemorySituations) FindAll() (situations []Situation)

func (*MemorySituations) FindByCode

func (manager *MemorySituations) FindByCode(code Code) (Situation, bool)

func (*MemorySituations) New

func (manager *MemorySituations) New() Situation

func (*MemorySituations) Save

func (manager *MemorySituations) Save(situation *Situation) bool

type MemoryStopAreaGroups

type MemoryStopAreaGroups struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryStopAreaGroups

func NewMemoryStopAreaGroups() *MemoryStopAreaGroups

func (*MemoryStopAreaGroups) Delete

func (manager *MemoryStopAreaGroups) Delete(stopAreaGroup *StopAreaGroup) bool

func (*MemoryStopAreaGroups) Find

func (*MemoryStopAreaGroups) FindAll

func (manager *MemoryStopAreaGroups) FindAll() (stopAreaGroups []*StopAreaGroup)

func (*MemoryStopAreaGroups) FindByShortName

func (manager *MemoryStopAreaGroups) FindByShortName(shortName string) (*StopAreaGroup, bool)

func (*MemoryStopAreaGroups) Load

func (manager *MemoryStopAreaGroups) Load(referentialSlug string) error

func (*MemoryStopAreaGroups) New

func (manager *MemoryStopAreaGroups) New() *StopAreaGroup

func (*MemoryStopAreaGroups) Save

func (manager *MemoryStopAreaGroups) Save(stopAreaGroup *StopAreaGroup) bool

type MemoryStopAreas

type MemoryStopAreas struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryStopAreas

func NewMemoryStopAreas() *MemoryStopAreas

func (*MemoryStopAreas) Delete

func (manager *MemoryStopAreas) Delete(stopArea *StopArea) bool

func (*MemoryStopAreas) Find

func (manager *MemoryStopAreas) Find(id StopAreaId) (*StopArea, bool)

func (*MemoryStopAreas) FindAll

func (manager *MemoryStopAreas) FindAll() (stopAreas []*StopArea)

func (*MemoryStopAreas) FindAllValues

func (manager *MemoryStopAreas) FindAllValues() (stopAreas []StopArea)

func (*MemoryStopAreas) FindAscendants

func (manager *MemoryStopAreas) FindAscendants(stopAreaId StopAreaId) (stopAreas []*StopArea)

func (*MemoryStopAreas) FindAscendantsWithCodeSpace

func (manager *MemoryStopAreas) FindAscendantsWithCodeSpace(stopAreaId StopAreaId, kind string) (stopAreaCodes []Code)

func (*MemoryStopAreas) FindByCode

func (manager *MemoryStopAreas) FindByCode(code Code) (*StopArea, bool)

func (*MemoryStopAreas) FindByLineId

func (manager *MemoryStopAreas) FindByLineId(id LineId) (stopAreas []*StopArea)

func (*MemoryStopAreas) FindByOrigin

func (manager *MemoryStopAreas) FindByOrigin(origin string) (stopAreas []StopAreaId)

func (*MemoryStopAreas) FindByParentId

func (manager *MemoryStopAreas) FindByParentId(id StopAreaId) (stopAreas []*StopArea)

func (*MemoryStopAreas) FindByReferentId

func (manager *MemoryStopAreas) FindByReferentId(id StopAreaId) (stopAreas []*StopArea)

func (*MemoryStopAreas) FindFamily

func (manager *MemoryStopAreas) FindFamily(stopAreaId StopAreaId) (stopAreaIds []StopAreaId)

func (*MemoryStopAreas) Load

func (manager *MemoryStopAreas) Load(referentialSlug string) error

func (*MemoryStopAreas) New

func (manager *MemoryStopAreas) New() *StopArea

func (*MemoryStopAreas) Save

func (manager *MemoryStopAreas) Save(stopArea *StopArea) bool

type MemoryStopVisits

type MemoryStopVisits struct {
	uuid.UUIDConsumer
	clock.ClockConsumer
	// contains filtered or unexported fields
}

func NewMemoryStopVisits

func NewMemoryStopVisits() *MemoryStopVisits

func (*MemoryStopVisits) Delete

func (manager *MemoryStopVisits) Delete(stopVisit *StopVisit) bool

func (*MemoryStopVisits) DeleteMultiple

func (manager *MemoryStopVisits) DeleteMultiple(stopVisits []*StopVisit) bool

func (*MemoryStopVisits) Find

func (manager *MemoryStopVisits) Find(id StopVisitId) (*StopVisit, bool)

func (*MemoryStopVisits) FindAll

func (manager *MemoryStopVisits) FindAll() (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindAllAfter

func (manager *MemoryStopVisits) FindAllAfter(t time.Time) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindByCode

func (manager *MemoryStopVisits) FindByCode(code Code) (*StopVisit, bool)

func (*MemoryStopVisits) FindByStopAreaId

func (manager *MemoryStopVisits) FindByStopAreaId(id StopAreaId) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindByVehicleJourneyId

func (manager *MemoryStopVisits) FindByVehicleJourneyId(id VehicleJourneyId) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindByVehicleJourneyIdAfter

func (manager *MemoryStopVisits) FindByVehicleJourneyIdAfter(id VehicleJourneyId, t time.Time) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindByVehicleJourneyIdAndStopAreaId

func (manager *MemoryStopVisits) FindByVehicleJourneyIdAndStopAreaId(vjId VehicleJourneyId, saId StopAreaId) []StopVisitId

func (*MemoryStopVisits) FindByVehicleJourneyIdAndStopVisitOrder

func (manager *MemoryStopVisits) FindByVehicleJourneyIdAndStopVisitOrder(vjId VehicleJourneyId, order int) *StopVisit

func (*MemoryStopVisits) FindFollowingByStopAreaId

func (manager *MemoryStopVisits) FindFollowingByStopAreaId(id StopAreaId) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindFollowingByStopAreaIds

func (manager *MemoryStopVisits) FindFollowingByStopAreaIds(stopAreaIds []StopAreaId) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindFollowingByVehicleJourneyId

func (manager *MemoryStopVisits) FindFollowingByVehicleJourneyId(id VehicleJourneyId) (stopVisits []*StopVisit)

func (*MemoryStopVisits) FindMonitoredByOriginByStopAreaId

func (manager *MemoryStopVisits) FindMonitoredByOriginByStopAreaId(id StopAreaId, origin string) (stopVisits []*StopVisit)

func (*MemoryStopVisits) Load

func (manager *MemoryStopVisits) Load(referentialSlug string) error

func (*MemoryStopVisits) New

func (manager *MemoryStopVisits) New() *StopVisit

func (*MemoryStopVisits) Save

func (manager *MemoryStopVisits) Save(stopVisit *StopVisit) bool

func (*MemoryStopVisits) StopVisitsLenByVehicleJourney

func (manager *MemoryStopVisits) StopVisitsLenByVehicleJourney(id VehicleJourneyId) int

func (*MemoryStopVisits) UnsafeDelete

func (manager *MemoryStopVisits) UnsafeDelete(stopVisit *StopVisit)

func (*MemoryStopVisits) UnsafeFindAll

func (manager *MemoryStopVisits) UnsafeFindAll() (stopVisits []*StopVisit)

Warning, this method doesn't copy the StopVisits so we shouldn't access its maps

func (*MemoryStopVisits) VehicleJourneyHasStopVisits

func (manager *MemoryStopVisits) VehicleJourneyHasStopVisits(id VehicleJourneyId) bool

type MemoryVehicleJourneys

type MemoryVehicleJourneys struct {
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func NewMemoryVehicleJourneys

func NewMemoryVehicleJourneys() *MemoryVehicleJourneys

func (*MemoryVehicleJourneys) Delete

func (manager *MemoryVehicleJourneys) Delete(vehicleJourney *VehicleJourney) bool

func (*MemoryVehicleJourneys) DeleteById

func (manager *MemoryVehicleJourneys) DeleteById(id VehicleJourneyId) bool

func (*MemoryVehicleJourneys) Find

func (*MemoryVehicleJourneys) FindAll

func (manager *MemoryVehicleJourneys) FindAll() (vehicleJourneys []*VehicleJourney)

func (*MemoryVehicleJourneys) FindByCode

func (manager *MemoryVehicleJourneys) FindByCode(code Code) (*VehicleJourney, bool)

func (*MemoryVehicleJourneys) FindByLineId

func (manager *MemoryVehicleJourneys) FindByLineId(id LineId) (vehicleJourneys []*VehicleJourney)

func (*MemoryVehicleJourneys) FullVehicleJourneyExistBySubscriptionId

func (manager *MemoryVehicleJourneys) FullVehicleJourneyExistBySubscriptionId(id string, vehicleJourneyId VehicleJourneyId) bool

func (*MemoryVehicleJourneys) Load

func (manager *MemoryVehicleJourneys) Load(referentialSlug string) error

func (*MemoryVehicleJourneys) New

func (manager *MemoryVehicleJourneys) New() *VehicleJourney

func (*MemoryVehicleJourneys) Save

func (manager *MemoryVehicleJourneys) Save(vehicleJourney *VehicleJourney) bool

func (*MemoryVehicleJourneys) SetFullVehicleJourneyBySubscriptionId

func (manager *MemoryVehicleJourneys) SetFullVehicleJourneyBySubscriptionId(id string, vehicleJourneyId VehicleJourneyId)

func (*MemoryVehicleJourneys) TestLenFullVehicleJourneyBySubscriptionId

func (manager *MemoryVehicleJourneys) TestLenFullVehicleJourneyBySubscriptionId() int

type MemoryVehicles

type MemoryVehicles struct {
	uuid.UUIDConsumer
	clock.ClockConsumer
	// contains filtered or unexported fields
}

func NewMemoryVehicles

func NewMemoryVehicles() *MemoryVehicles

func (*MemoryVehicles) Delete

func (manager *MemoryVehicles) Delete(vehicle *Vehicle) bool

func (*MemoryVehicles) Find

func (manager *MemoryVehicles) Find(id VehicleId) (*Vehicle, bool)

func (*MemoryVehicles) FindAll

func (manager *MemoryVehicles) FindAll() (vehicles []*Vehicle)

func (*MemoryVehicles) FindByCode

func (manager *MemoryVehicles) FindByCode(code Code) (*Vehicle, bool)

func (*MemoryVehicles) FindByLineId

func (manager *MemoryVehicles) FindByLineId(id LineId) (vehicles []*Vehicle)

func (*MemoryVehicles) FindByNextStopVisitId

func (manager *MemoryVehicles) FindByNextStopVisitId(stopVisitId StopVisitId) (*Vehicle, bool)

func (*MemoryVehicles) New

func (manager *MemoryVehicles) New() *Vehicle

func (*MemoryVehicles) Save

func (manager *MemoryVehicles) Save(vehicle *Vehicle) bool

type Model

type Model interface {
	Date() Date
	Referential() string
	Lines() Lines
	LineGroups() LineGroups
	StopAreaGroups() StopAreaGroups
	Situations() Situations
	StopAreas() StopAreas
	StopVisits() StopVisits
	ScheduledStopVisits() StopVisits
	VehicleJourneys() VehicleJourneys
	Operators() Operators
	Vehicles() Vehicles
	Macros() Macros
}

type ModelId

type ModelId string

type ModelInstance

type ModelInstance interface {
	CodeConsumerInterface
	// contains filtered or unexported methods
}

type ModelType

type ModelType uint8
const (
	StopAreaType ModelType = iota
	LineType
	VehicleJourneyType
	StopVisitType
	VehicleType
	MacroSituationType
)

type NotCollectedUpdateEvent

type NotCollectedUpdateEvent struct {
	Code           Code
	NotCollectedAt time.Time
}

func NewNotCollectedUpdateEvent

func NewNotCollectedUpdateEvent(obj Code, t time.Time) *NotCollectedUpdateEvent

func (*NotCollectedUpdateEvent) EventKind

func (ue *NotCollectedUpdateEvent) EventKind() EventKind

type ObjectId

type ObjectId Code

func (*ObjectId) UnmarshalJSON

func (objectId *ObjectId) UnmarshalJSON(data []byte) error

type Operator

type Operator struct {
	CodeConsumer

	Name string `json:",omitempty"`
	// contains filtered or unexported fields
}

func NewOperator

func NewOperator(model Model) *Operator

func (*Operator) Id

func (operator *Operator) Id() OperatorId

func (*Operator) MarshalJSON

func (operator *Operator) MarshalJSON() ([]byte, error)

func (*Operator) Save

func (operator *Operator) Save() bool

func (*Operator) UnmarshalJSON

func (operator *Operator) UnmarshalJSON(data []byte) error

type OperatorId

type OperatorId string

type Operators

type Operators interface {
	uuid.UUIDInterface

	New() *Operator
	Find(OperatorId) (*Operator, bool)
	FindByCode(Code) (*Operator, bool)
	FindAll() []*Operator
	Save(*Operator) bool
	Delete(*Operator) bool
}

type PublishToDisplayAction

type PublishToDisplayAction struct {
	ActionCommon

	OnPlace *bool `json:",omitempty"`
	OnBoard *bool `json:",omitempty"`
}

type PublishToMobileAction

type PublishToMobileAction struct {
	ActionCommon

	Incidents *bool `json:",omitempty"`
	HomePage  *bool `json:",omitempty"`
}

type PublishToWebAction

type PublishToWebAction struct {
	ActionCommon

	Incidents      *bool    `json:",omitempty"`
	HomePage       *bool    `json:",omitempty"`
	Ticker         *bool    `json:",omitempty"`
	SocialNetworks []string `json:",omitempty"`
}

type Purifier

type Purifier struct {
	// contains filtered or unexported fields
}

func NewPurifier

func NewPurifier(days int) *Purifier

func (*Purifier) Purge

func (p *Purifier) Purge() error

type Reference

type Reference struct {
	Code *Code  `json:",omitempty"`
	Type string `json:",omitempty"`
}

func NewReference

func NewReference(code Code) *Reference

func (*Reference) GetSha1

func (reference *Reference) GetSha1() string

func (*Reference) UnmarshalJSON

func (reference *Reference) UnmarshalJSON(data []byte) error

type References

type References struct {
	// contains filtered or unexported fields
}

func NewReferences

func NewReferences() References

func (*References) Copy

func (references *References) Copy() References

func (*References) Get

func (references *References) Get(key string) (Reference, bool)

func (*References) GetReferences

func (references *References) GetReferences() map[string]Reference

func (*References) GetSiriReferences

func (references *References) GetSiriReferences() map[string]string

func (*References) IsEmpty

func (references *References) IsEmpty() bool

func (*References) Set

func (references *References) Set(key string, value Reference)

func (*References) SetCode

func (references *References) SetCode(key string, obj Code)

func (*References) SetReference

func (references *References) SetReference(key string, r Reference)

func (*References) SetReferences

func (references *References) SetReferences(r map[string]Reference)

type ReportType

type ReportType string

type Result

type Result struct {
	Import map[string]int64
	Errors map[string][]string
}

func (Result) ErrorCount

func (r Result) ErrorCount() int64

func (Result) Inserted

func (r Result) Inserted(m string) int64

func (Result) PrintResult

func (r Result) PrintResult() string

func (Result) TotalInserts

func (r Result) TotalInserts() int64

type SelectLine

type SelectLine struct {
	Id                string
	ReferentialSlug   string         `db:"referential_slug"`
	ModelName         string         `db:"model_name"`
	ReferentId        sql.NullString `db:"referent_id"`
	Name              sql.NullString
	Number            sql.NullString `db:"number"`
	Codes             sql.NullString `db:"codes"`
	Attributes        sql.NullString
	References        sql.NullString `db:"siri_references"`
	CollectSituations sql.NullBool   `db:"collect_situations"`
}

type SelectLineGroup

type SelectLineGroup struct {
	Id              string
	ReferentialSlug string         `db:"referential_slug"`
	ModelName       string         `db:"model_name"`
	Name            sql.NullString `db:"name"`
	ShortName       sql.NullString `db:"short_name"`
	LineIds         sql.NullString `db:"line_ids"`
}

type SelectMacro

type SelectMacro struct {
	Id              string
	ReferentialSlug string         `db:"referential_slug"`
	ContextId       sql.NullString `db:"context_id"`
	Position        int
	Type            string
	ModelType       sql.NullString `db:"model_type"`
	Hook            sql.NullString
	Attributes      sql.NullString
}

type SelectOperator

type SelectOperator struct {
	Id              string
	ReferentialSlug string `db:"referential_slug"`
	ModelName       string `db:"model_name"`
	Name            sql.NullString
	Codes           sql.NullString `db:"codes"`
}

type SelectPartner

type SelectPartner struct {
	Id             string
	ReferentialId  string `db:"referential_id"`
	Slug           string
	Name           sql.NullString
	Settings       sql.NullString
	ConnectorTypes sql.NullString `db:"connector_types"`
}

type SelectReferential

type SelectReferential struct {
	ReferentialId  string         `db:"referential_id"`
	OrganisationId sql.NullString `db:"organisation_id"`
	Slug           string
	Name           sql.NullString
	Settings       sql.NullString
	Tokens         sql.NullString
	ImportTokens   sql.NullString `db:"import_tokens"`
}

type SelectStopArea

type SelectStopArea struct {
	Id                string
	ReferentialSlug   string `db:"referential_slug"`
	ModelName         string `db:"model_name"`
	Name              sql.NullString
	Codes             sql.NullString `db:"codes"`
	ParentId          sql.NullString `db:"parent_id"`
	ReferentId        sql.NullString `db:"referent_id"`
	Attributes        sql.NullString
	References        sql.NullString `db:"siri_references"`
	LineIds           sql.NullString `db:"line_ids"`
	CollectedAlways   sql.NullBool   `db:"collected_always"`
	CollectChildren   sql.NullBool   `db:"collect_children"`
	CollectSituations sql.NullBool   `db:"collect_situations"`
}

type SelectStopAreaGroup

type SelectStopAreaGroup struct {
	Id              string
	ReferentialSlug string         `db:"referential_slug"`
	ModelName       string         `db:"model_name"`
	Name            sql.NullString `db:"name"`
	ShortName       sql.NullString `db:"short_name"`
	StopAreaIds     sql.NullString `db:"stop_area_ids"`
}

type SelectStopVisit

type SelectStopVisit struct {
	Id               string
	ReferentialSlug  string         `db:"referential_slug"`
	ModelName        string         `db:"model_name"`
	Codes            sql.NullString `db:"codes"`
	StopAreaId       sql.NullString `db:"stop_area_id"`
	VehicleJourneyId sql.NullString `db:"vehicle_journey_id"`
	Schedules        sql.NullString `db:"schedules"`
	Attributes       sql.NullString `db:"attributes"`
	References       sql.NullString `db:"siri_references"`
	PassageOrder     sql.NullInt64  `db:"passage_order"`
}

type SelectVehicleJourney

type SelectVehicleJourney struct {
	Id              string
	ReferentialSlug string `db:"referential_slug"`
	ModelName       string `db:"model_name"`
	Name            sql.NullString
	Codes           sql.NullString `db:"codes"`
	LineId          sql.NullString `db:"line_id"`
	OriginName      sql.NullString `db:"origin_name"`
	DestinationName sql.NullString `db:"destination_name"`
	DirectionType   sql.NullString `db:"direction_type"`
	Attributes      sql.NullString
	References      sql.NullString `db:"siri_references"`
}

type Situation

type Situation struct {
	CodeConsumer

	Origin string

	RecordedAt time.Time
	Version    int `json:",omitempty"`

	VersionedAt        time.Time
	ValidityPeriods    []*TimeRange
	PublicationWindows []*TimeRange

	Progress       SituationProgress   `json:",omitempty"`
	Severity       SituationSeverity   `json:",omitempty"`
	Keywords       []string            `json:",omitempty"`
	ReportType     ReportType          `json:",omitempty"`
	AlertCause     SituationAlertCause `json:",omitempty"`
	Reality        SituationReality    `json:",omitempty"`
	ProducerRef    string              `json:",omitempty"`
	Format         string              `json:",omitempty"`
	InternalTags   []string            `json:",omitempty"`
	ParticipantRef string              `json:",omitempty"`
	Summary        *TranslatedString   `json:",omitempty"`
	Description    *TranslatedString   `json:",omitempty"`

	Affects                 Affects                   `json:",omitempty"`
	Consequences            []*Consequence            `json:",omitempty"`
	PublishToWebActions     []*PublishToWebAction     `json:",omitempty"`
	PublishToMobileActions  []*PublishToMobileAction  `json:",omitempty"`
	PublishToDisplayActions []*PublishToDisplayAction `json:",omitempty"`
	InfoLinks               []*InfoLink               `json:",omitempty"`
	// contains filtered or unexported fields
}

func NewSituation

func NewSituation(model Model) *Situation

func (*Situation) Definition

func (situation *Situation) Definition() *APISituation

func (*Situation) GMValidUntil

func (situation *Situation) GMValidUntil() time.Time

func (*Situation) GetGMChannel

func (situation *Situation) GetGMChannel() (string, bool)

func (*Situation) Id

func (situation *Situation) Id() SituationId

func (*Situation) MarshalJSON

func (situation *Situation) MarshalJSON() ([]byte, error)

func (*Situation) Save

func (situation *Situation) Save() (ok bool)

func (*Situation) SetDefinition

func (situation *Situation) SetDefinition(apiSituation *APISituation)

type SituationActionStatus

type SituationActionStatus string
const (
	SituationActionStatusOpen      SituationActionStatus = "open"
	SituationActionStatusPublished SituationActionStatus = "published"
	SituationActionStatusClosed    SituationActionStatus = "closed"
)

func (*SituationActionStatus) FromString

func (as *SituationActionStatus) FromString(s string) error

type SituationAlertCause

type SituationAlertCause string
const (
	SituationAlertCauseAccident                          SituationAlertCause = "accident"
	SituationAlertCauseAirraid                           SituationAlertCause = "airRaid"
	SituationAlertCauseAltercation                       SituationAlertCause = "altercation"
	SituationAlertCauseAnimalontheline                   SituationAlertCause = "animalOnTheLine"
	SituationAlertCauseAsphalting                        SituationAlertCause = "asphalting"
	SituationAlertCauseAssault                           SituationAlertCause = "assault"
	SituationAlertCauseAttack                            SituationAlertCause = "attack"
	SituationAlertCauseAvalanches                        SituationAlertCause = "avalanches"
	SituationAlertCauseAwaitingapproach                  SituationAlertCause = "awaitingApproach"
	SituationAlertCauseAwaitingoncomingvehicle           SituationAlertCause = "awaitingOncomingVehicle"
	SituationAlertCauseAwaitingshuttle                   SituationAlertCause = "awaitingShuttle"
	SituationAlertCauseBlizzardconditions                SituationAlertCause = "blizzardConditions"
	SituationAlertCauseBoardingdelay                     SituationAlertCause = "boardingDelay"
	SituationAlertCauseBombalert                         SituationAlertCause = "bombAlert"
	SituationAlertCauseBombdisposal                      SituationAlertCause = "bombDisposal"
	SituationAlertCauseBombexplosion                     SituationAlertCause = "bombExplosion"
	SituationAlertCauseBordercontrol                     SituationAlertCause = "borderControl"
	SituationAlertCauseBreakdown                         SituationAlertCause = "breakDown"
	SituationAlertCauseBridgedamage                      SituationAlertCause = "bridgeDamage"
	SituationAlertCauseBridgestrike                      SituationAlertCause = "bridgeStrike"
	SituationAlertCauseBrokenrail                        SituationAlertCause = "brokenRail"
	SituationAlertCauseCablefire                         SituationAlertCause = "cableFire"
	SituationAlertCauseCabletheft                        SituationAlertCause = "cableTheft"
	SituationAlertCauseChangeincarriages                 SituationAlertCause = "changeInCarriages"
	SituationAlertCauseCivilemergency                    SituationAlertCause = "civilEmergency"
	SituationAlertCauseClosedformaintenance              SituationAlertCause = "closedForMaintenance"
	SituationAlertCauseCollision                         SituationAlertCause = "collision"
	SituationAlertCauseCongestion                        SituationAlertCause = "congestion"
	SituationAlertCauseConstructionwork                  SituationAlertCause = "constructionWork"
	SituationAlertCauseContractorstaffinjury             SituationAlertCause = "contractorStaffInjury"
	SituationAlertCauseDefectivecctv                     SituationAlertCause = "defectiveCctv"
	SituationAlertCauseDefectivefirealarmequipment       SituationAlertCause = "defectiveFireAlarmEquipment"
	SituationAlertCauseDefectiveplatformedgedoors        SituationAlertCause = "defectivePlatformEdgeDoors"
	SituationAlertCauseDefectivepublicannouncementsystem SituationAlertCause = "defectivePublicAnnouncementSystem"
	SituationAlertCauseDefectivesecuritysystem           SituationAlertCause = "defectiveSecuritySystem"
	SituationAlertCauseDefectivetrain                    SituationAlertCause = "defectiveTrain"
	SituationAlertCauseDefectivevehicle                  SituationAlertCause = "defectiveVehicle"
	SituationAlertCauseDeicingwork                       SituationAlertCause = "deicingWork"
	SituationAlertCauseDemonstration                     SituationAlertCause = "demonstration"
	SituationAlertCauseDerailment                        SituationAlertCause = "derailment"
	SituationAlertCauseDoorfailure                       SituationAlertCause = "doorFailure"
	SituationAlertCauseDriftingsnow                      SituationAlertCause = "driftingSnow"
	SituationAlertCauseEarthquakedamage                  SituationAlertCause = "earthquakeDamage"
	SituationAlertCauseEmergencybrake                    SituationAlertCause = "emergencyBrake"
	SituationAlertCauseEmergencyengineeringwork          SituationAlertCause = "emergencyEngineeringWork"
	SituationAlertCauseEmergencymedicalservices          SituationAlertCause = "emergencyMedicalServices"
	SituationAlertCauseEmergencyservices                 SituationAlertCause = "emergencyServices"
	SituationAlertCauseEmergencyservicescall             SituationAlertCause = "emergencyServicesCall"
	SituationAlertCauseEnginefailure                     SituationAlertCause = "engineFailure"
	SituationAlertCauseEscalatorfailure                  SituationAlertCause = "escalatorFailure"
	SituationAlertCauseEvacuation                        SituationAlertCause = "evacuation"
	SituationAlertCauseExplosion                         SituationAlertCause = "explosion"
	SituationAlertCauseExplosionhazard                   SituationAlertCause = "explosionHazard"
	SituationAlertCauseFallenleaves                      SituationAlertCause = "fallenLeaves"
	SituationAlertCauseFallentree                        SituationAlertCause = "fallenTree"
	SituationAlertCauseFallentreeontheline               SituationAlertCause = "fallenTreeOnTheLine"
	SituationAlertCauseFatality                          SituationAlertCause = "fatality"
	SituationAlertCauseFilterblockade                    SituationAlertCause = "filterBlockade"
	SituationAlertCauseFire                              SituationAlertCause = "fire"
	SituationAlertCauseFireatstation                     SituationAlertCause = "fireAtStation"
	SituationAlertCauseFireatthestation                  SituationAlertCause = "fireAtTheStation"
	SituationAlertCauseFirebrigadeorder                  SituationAlertCause = "fireBrigadeOrder"
	SituationAlertCauseFirebrigadesafetychecks           SituationAlertCause = "fireBrigadeSafetyChecks"
	SituationAlertCauseFirerun                           SituationAlertCause = "fireRun"
	SituationAlertCauseFlashfloods                       SituationAlertCause = "flashFloods"
	SituationAlertCauseFlooding                          SituationAlertCause = "flooding"
	SituationAlertCauseFog                               SituationAlertCause = "fog"
	SituationAlertCauseForeigndisturbances               SituationAlertCause = "foreignDisturbances"
	SituationAlertCauseFrozen                            SituationAlertCause = "frozen"
	SituationAlertCauseFuelproblem                       SituationAlertCause = "fuelProblem"
	SituationAlertCauseFuelshortage                      SituationAlertCause = "fuelShortage"
	SituationAlertCauseGangwayproblem                    SituationAlertCause = "gangwayProblem"
	SituationAlertCauseGlazedfrost                       SituationAlertCause = "glazedFrost"
	SituationAlertCauseGrassfire                         SituationAlertCause = "grassFire"
	SituationAlertCauseGunfireonroadway                  SituationAlertCause = "gunfireOnRoadway"
	SituationAlertCauseHail                              SituationAlertCause = "hail"
	SituationAlertCauseHeavyrain                         SituationAlertCause = "heavyRain"
	SituationAlertCauseHeavysnowfall                     SituationAlertCause = "heavySnowfall"
	SituationAlertCauseHeavytraffic                      SituationAlertCause = "heavyTraffic"
	SituationAlertCauseHightemperatures                  SituationAlertCause = "highTemperatures"
	SituationAlertCauseHightide                          SituationAlertCause = "highTide"
	SituationAlertCauseHighwaterlevel                    SituationAlertCause = "highWaterLevel"
	SituationAlertCauseHoliday                           SituationAlertCause = "holiday"
	SituationAlertCauseIce                               SituationAlertCause = "ice"
	SituationAlertCauseIcedrift                          SituationAlertCause = "iceDrift"
	SituationAlertCauseIceoncarriages                    SituationAlertCause = "iceOnCarriages"
	SituationAlertCauseIceonrailway                      SituationAlertCause = "iceOnRailway"
	SituationAlertCauseIllvehicleoccupants               SituationAlertCause = "illVehicleOccupants"
	SituationAlertCauseIncident                          SituationAlertCause = "incident"
	SituationAlertCauseIndustrialaction                  SituationAlertCause = "industrialAction"
	SituationAlertCauseInsufficientdemand                SituationAlertCause = "insufficientDemand"
	SituationAlertCauseLackofoperationalstock            SituationAlertCause = "lackOfOperationalStock"
	SituationAlertCauseLandslide                         SituationAlertCause = "landslide"
	SituationAlertCauseLatefinishtoengineeringwork       SituationAlertCause = "lateFinishToEngineeringWork"
	SituationAlertCauseLeaderboardfailure                SituationAlertCause = "leaderBoardFailure"
	SituationAlertCauseLevelcrossingaccident             SituationAlertCause = "levelCrossingAccident"
	SituationAlertCauseLevelcrossingblocked              SituationAlertCause = "levelCrossingBlocked"
	SituationAlertCauseLevelcrossingfailure              SituationAlertCause = "levelCrossingFailure"
	SituationAlertCauseLevelcrossingincident             SituationAlertCause = "levelCrossingIncident"
	SituationAlertCauseLiftfailure                       SituationAlertCause = "liftFailure"
	SituationAlertCauseLightingfailure                   SituationAlertCause = "lightingFailure"
	SituationAlertCauseLightningstrike                   SituationAlertCause = "lightningStrike"
	SituationAlertCauseLinesidefire                      SituationAlertCause = "linesideFire"
	SituationAlertCauseLogisticproblems                  SituationAlertCause = "logisticProblems"
	SituationAlertCauseLowtide                           SituationAlertCause = "lowTide"
	SituationAlertCauseLowwaterlevel                     SituationAlertCause = "lowWaterLevel"
	SituationAlertCauseLuggagecarouselproblem            SituationAlertCause = "luggageCarouselProblem"
	SituationAlertCauseMaintenancework                   SituationAlertCause = "maintenanceWork"
	SituationAlertCauseMarch                             SituationAlertCause = "march"
	SituationAlertCauseMiscellaneous                     SituationAlertCause = "miscellaneous"
	SituationAlertCauseMudslide                          SituationAlertCause = "mudslide"
	SituationAlertCauseNearmiss                          SituationAlertCause = "nearMiss"
	SituationAlertCauseObjectontheline                   SituationAlertCause = "objectOnTheLine"
	SituationAlertCauseOperatorceasedtrading             SituationAlertCause = "operatorCeasedTrading"
	SituationAlertCauseOperatorsuspended                 SituationAlertCause = "operatorSuspended"
	SituationAlertCauseOvercrowded                       SituationAlertCause = "overcrowded"
	SituationAlertCauseOverheadobstruction               SituationAlertCause = "overheadObstruction"
	SituationAlertCauseOverheadwirefailure               SituationAlertCause = "overheadWireFailure"
	SituationAlertCauseOvertaking                        SituationAlertCause = "overtaking"
	SituationAlertCausePassengeraction                   SituationAlertCause = "passengerAction"
	SituationAlertCausePassengersblockingdoors           SituationAlertCause = "passengersBlockingDoors"
	SituationAlertCausePaving                            SituationAlertCause = "paving"
	SituationAlertCausePersonhitbytrain                  SituationAlertCause = "personHitByTrain"
	SituationAlertCausePersonhitbyvehicle                SituationAlertCause = "personHitByVehicle"
	SituationAlertCausePersonillonvehicle                SituationAlertCause = "personIllOnVehicle"
	SituationAlertCausePersonontheline                   SituationAlertCause = "personOnTheLine"
	SituationAlertCausePersonundertrain                  SituationAlertCause = "personUnderTrain"
	SituationAlertCausePointsfailure                     SituationAlertCause = "pointsFailure"
	SituationAlertCausePointsproblem                     SituationAlertCause = "pointsProblem"
	SituationAlertCausePoliceactivity                    SituationAlertCause = "policeActivity"
	SituationAlertCausePoliceorder                       SituationAlertCause = "policeOrder"
	SituationAlertCausePoorrailconditions                SituationAlertCause = "poorRailConditions"
	SituationAlertCausePoorweather                       SituationAlertCause = "poorWeather"
	SituationAlertCausePowerproblem                      SituationAlertCause = "powerProblem"
	SituationAlertCausePrecedingvehicle                  SituationAlertCause = "precedingVehicle"
	SituationAlertCausePreviousdisturbances              SituationAlertCause = "previousDisturbances"
	SituationAlertCauseProblemsatborderpost              SituationAlertCause = "problemsAtBorderPost"
	SituationAlertCauseProblemsatcustomspost             SituationAlertCause = "problemsAtCustomsPost"
	SituationAlertCauseProblemsonlocalroad               SituationAlertCause = "problemsOnLocalRoad"
	SituationAlertCauseProcession                        SituationAlertCause = "procession"
	SituationAlertCauseProvisiondelay                    SituationAlertCause = "provisionDelay"
	SituationAlertCausePublicdisturbance                 SituationAlertCause = "publicDisturbance"
	SituationAlertCauseRailwaycrime                      SituationAlertCause = "railwayCrime"
	SituationAlertCauseRepairwork                        SituationAlertCause = "repairWork"
	SituationAlertCauseRiskofavalanches                  SituationAlertCause = "riskOfAvalanches"
	SituationAlertCauseRiskofflooding                    SituationAlertCause = "riskOfFlooding"
	SituationAlertCauseRiskoflandslide                   SituationAlertCause = "riskOfLandslide"
	SituationAlertCauseRoadclosed                        SituationAlertCause = "roadClosed"
	SituationAlertCauseRoadmaintenance                   SituationAlertCause = "roadMaintenance"
	SituationAlertCauseRoadwaydamage                     SituationAlertCause = "roadwayDamage"
	SituationAlertCauseRoadworks                         SituationAlertCause = "roadworks"
	SituationAlertCauseRockfalls                         SituationAlertCause = "rockfalls"
	SituationAlertCauseRoughsea                          SituationAlertCause = "roughSea"
	SituationAlertCauseRouteblockage                     SituationAlertCause = "routeBlockage"
	SituationAlertCauseRoutediversion                    SituationAlertCause = "routeDiversion"
	SituationAlertCauseSabotage                          SituationAlertCause = "sabotage"
	SituationAlertCauseSafetyviolation                   SituationAlertCause = "safetyViolation"
	SituationAlertCauseSecurityalert                     SituationAlertCause = "securityAlert"
	SituationAlertCauseSecurityincident                  SituationAlertCause = "securityIncident"
	SituationAlertCauseServicedisruption                 SituationAlertCause = "serviceDisruption"
	SituationAlertCauseServicefailure                    SituationAlertCause = "serviceFailure"
	SituationAlertCauseServiceindicatorfailure           SituationAlertCause = "serviceIndicatorFailure"
	SituationAlertCauseSeweragemaintenance               SituationAlertCause = "sewerageMaintenance"
	SituationAlertCauseSeweroverflow                     SituationAlertCause = "sewerOverflow"
	SituationAlertCauseSightseersobstructingaccess       SituationAlertCause = "sightseersObstructingAccess"
	SituationAlertCauseSignalandswitchfailure            SituationAlertCause = "signalAndSwitchFailure"
	SituationAlertCauseSignalfailure                     SituationAlertCause = "signalFailure"
	SituationAlertCauseSignalpassedatdanger              SituationAlertCause = "signalPassedAtDanger"
	SituationAlertCauseSignalproblem                     SituationAlertCause = "signalProblem"
	SituationAlertCauseSleet                             SituationAlertCause = "sleet"
	SituationAlertCauseSlipperiness                      SituationAlertCause = "slipperiness"
	SituationAlertCauseSlipperytrack                     SituationAlertCause = "slipperyTrack"
	SituationAlertCauseSmokedetectedonvehicle            SituationAlertCause = "smokeDetectedOnVehicle"
	SituationAlertCauseSpecialevent                      SituationAlertCause = "specialEvent"
	SituationAlertCauseSpeedrestrictions                 SituationAlertCause = "speedRestrictions"
	SituationAlertCauseStaffabsence                      SituationAlertCause = "staffAbsence"
	SituationAlertCauseStaffassault                      SituationAlertCause = "staffAssault"
	SituationAlertCauseStaffinjury                       SituationAlertCause = "staffInjury"
	SituationAlertCauseStaffinwrongplace                 SituationAlertCause = "staffInWrongPlace"
	SituationAlertCauseStaffshortage                     SituationAlertCause = "staffShortage"
	SituationAlertCauseStaffsickness                     SituationAlertCause = "staffSickness"
	SituationAlertCauseStationoverrun                    SituationAlertCause = "stationOverrun"
	SituationAlertCauseStormconditions                   SituationAlertCause = "stormConditions"
	SituationAlertCauseStormdamage                       SituationAlertCause = "stormDamage"
	SituationAlertCauseStrongwinds                       SituationAlertCause = "strongWinds"
	SituationAlertCauseSubsidence                        SituationAlertCause = "subsidence"
	SituationAlertCauseSuspectvehicle                    SituationAlertCause = "suspectVehicle"
	SituationAlertCauseSwingbridgefailure                SituationAlertCause = "swingBridgeFailure"
	SituationAlertCauseTechnicalproblem                  SituationAlertCause = "technicalProblem"
	SituationAlertCauseTelephonedthreat                  SituationAlertCause = "telephonedThreat"
	SituationAlertCauseTerroristincident                 SituationAlertCause = "terroristIncident"
	SituationAlertCauseTheft                             SituationAlertCause = "theft"
	SituationAlertCauseTicketingsystemnotavailable       SituationAlertCause = "ticketingSystemNotAvailable"
	SituationAlertCauseTidalrestrictions                 SituationAlertCause = "tidalRestrictions"
	SituationAlertCauseTrackcircuitproblem               SituationAlertCause = "trackCircuitProblem"
	SituationAlertCauseTractionfailure                   SituationAlertCause = "tractionFailure"
	SituationAlertCauseTrafficmanagementsystemfailure    SituationAlertCause = "trafficManagementSystemFailure"
	SituationAlertCauseTraincoupling                     SituationAlertCause = "trainCoupling"
	SituationAlertCauseTraindoor                         SituationAlertCause = "trainDoor"
	SituationAlertCauseTrainstruckanimal                 SituationAlertCause = "trainStruckAnimal"
	SituationAlertCauseTrainstruckobject                 SituationAlertCause = "trainStruckObject"
	SituationAlertCauseTrainwarningsystemproblem         SituationAlertCause = "trainWarningSystemProblem"
	SituationAlertCauseUnattendedbag                     SituationAlertCause = "unattendedBag"
	SituationAlertCauseUndefinedalertcause               SituationAlertCause = "undefinedAlertCause"
	SituationAlertCauseUndefinedenvironmentalproblem     SituationAlertCause = "undefinedEnvironmentalProblem"
	SituationAlertCauseUndefinedequipmentproblem         SituationAlertCause = "undefinedEquipmentProblem"
	SituationAlertCauseUndefinedpersonnelproblem         SituationAlertCause = "undefinedPersonnelProblem"
	SituationAlertCauseUndefinedproblem                  SituationAlertCause = "undefinedProblem"
	SituationAlertCauseUnknown                           SituationAlertCause = "unknown"
	SituationAlertCauseUnofficialindustrialaction        SituationAlertCause = "unofficialIndustrialAction"
	SituationAlertCauseUnscheduledconstructionwork       SituationAlertCause = "unscheduledConstructionWork"
	SituationAlertCauseVandalism                         SituationAlertCause = "vandalism"
	SituationAlertCauseVegetation                        SituationAlertCause = "vegetation"
	SituationAlertCauseVehicleblockingtrack              SituationAlertCause = "vehicleBlockingTrack"
	SituationAlertCauseVehiclefailure                    SituationAlertCause = "vehicleFailure"
	SituationAlertCauseVehicleontheline                  SituationAlertCause = "vehicleOnTheLine"
	SituationAlertCauseVehiclestruckanimal               SituationAlertCause = "vehicleStruckAnimal"
	SituationAlertCauseVehiclestruckobject               SituationAlertCause = "vehicleStruckObject"
	SituationAlertCauseViaductfailure                    SituationAlertCause = "viaductFailure"
	SituationAlertCauseWaitingfortransferpassengers      SituationAlertCause = "waitingForTransferPassengers"
	SituationAlertCauseWaterlogged                       SituationAlertCause = "waterlogged"
	SituationAlertCauseWheelimpactload                   SituationAlertCause = "wheelImpactLoad"
	SituationAlertCauseWheelproblem                      SituationAlertCause = "wheelProblem"
	SituationAlertCauseWildlandfire                      SituationAlertCause = "wildlandFire"
	SituationAlertCauseWorktorule                        SituationAlertCause = "workToRule"
)

func (*SituationAlertCause) FromProto

func (ac *SituationAlertCause) FromProto(value interface{}) error

func (*SituationAlertCause) FromString

func (alertCause *SituationAlertCause) FromString(s string) error

func (SituationAlertCause) ToProto

func (ac SituationAlertCause) ToProto(dest interface{}) error

type SituationBroadcastEvent

type SituationBroadcastEvent struct {
	SituationId SituationId
}

type SituationCondition

type SituationCondition string
const (
	SituationConditionAdditionalRide              SituationCondition = "additionalRide"
	SituationConditionAdditionalService           SituationCondition = "additionalService"
	SituationContitionAdditionalStop              SituationCondition = "additionalStop"
	SituationConditionAltered                     SituationCondition = "altered"
	SituationConditionArrivesEarly                SituationCondition = "arrivesEarly"
	SituationConditionBoarding                    SituationCondition = "boarding"
	SituationConditionCancelled                   SituationCondition = "cancelled"
	SituationConditionChangeOfPlatform            SituationCondition = "changeOfPlatform"
	SituationConditionDelay                       SituationCondition = "delay"
	SituationConditionDelayed                     SituationCondition = "delayed"
	SituationConditionDiscontinuedOperation       SituationCondition = "discontinuedOperation"
	SituationConditionDisrupted                   SituationCondition = "disrupted"
	SituationConditionDisruption                  SituationCondition = "disruption"
	SituationConditionDisturbanceRectified        SituationCondition = "disturbanceRectified"
	SituationConditionDiverted                    SituationCondition = "diverted"
	SituationConditionExtendedService             SituationCondition = "extendedService"
	SituationConditionFullLengthService           SituationCondition = "fullLengthService"
	SituationConditionGoToGate                    SituationCondition = "goToGate"
	SituationConditionIntermittentService         SituationCondition = "intermittentService"
	SituationConditionIrregularTraffic            SituationCondition = "irregularTraffic"
	SituationConditionLimitedOperation            SituationCondition = "limitedOperation"
	SituationConditionLineCancellation            SituationCondition = "lineCancellation"
	SituationConditionMajorDelays                 SituationCondition = "majorDelays"
	SituationConditionMinorDelays                 SituationCondition = "minorDelays"
	SituationConditionNormalService               SituationCondition = "normalService"
	SituationConditionNoService                   SituationCondition = "noService"
	SituationConditionOnTime                      SituationCondition = "onTime"
	SituationConditionOperationTimeExtension      SituationCondition = "operationTimeExtension"
	SituationConditionReplacementRide             SituationCondition = "replacementRide"
	SituationConditionReplacementService          SituationCondition = "replacementService"
	SituationConditionReplacementTransport        SituationCondition = "replacementTransport"
	SituationConditionShortFormedService          SituationCondition = "shortFormedService"
	SituationConditionShuttleService              SituationCondition = "shuttleService"
	SituationConditionSpecialService              SituationCondition = "specialService"
	SituationConditionSplittingTrain              SituationCondition = "splittingTrain"
	SituationConditionStopCancelled               SituationCondition = "stopCancelled"
	SituationConditionStopMove                    SituationCondition = "stopMoved"
	SituationConditionStopOnDemand                SituationCondition = "stopOnDemand"
	SituationConditionSubstitutedStop             SituationCondition = "substitutedStop"
	SituationConditionTemporarilyNonStopping      SituationCondition = "temporarilyNonStopping"
	SituationConditionTemporaryStopplace          SituationCondition = "temporaryStopplace"
	SituationConditionTrainShortened              SituationCondition = "trainShortened"
	SituationConditionTripCancellation            SituationCondition = "tripCancellation"
	SituationConditionUndefinedServiceInformation SituationCondition = "undefinedServiceInformation"
	SituationConditionUndefinedStatus             SituationCondition = "undefinedStatus"
	SituationConditionUnknown                     SituationCondition = "unknown"
	SituationConditionWagonOrderChanged           SituationCondition = "wagonOrderChanged"
)

func (*SituationCondition) FromProto

func (c *SituationCondition) FromProto(value interface{}) error

func (*SituationCondition) FromString

func (condition *SituationCondition) FromString(c string) error

func (SituationCondition) ToProto

func (c SituationCondition) ToProto(dest interface{}) error

type SituationId

type SituationId ModelId

type SituationLinkContent

type SituationLinkContent string
const (
	SituationLinkContentAdvice      SituationLinkContent = "advice"
	SituationLinkContentDetails     SituationLinkContent = "details"
	SituationLinkContentOther       SituationLinkContent = "other"
	SituationLinkContentRelatedSite SituationLinkContent = "relatedSite"
	SituationLinkContentTimetable   SituationLinkContent = "timetable"
)

func (*SituationLinkContent) FromString

func (lc *SituationLinkContent) FromString(s string) error

type SituationProgress

type SituationProgress string
const (
	SituationProgressDraft           SituationProgress = "draft"
	SituationProgressPendingApproval SituationProgress = "pendingApproval"
	SituationProgressApprovedDraft   SituationProgress = "approvedDraft"
	SituationProgressOpend           SituationProgress = "open"
	SituationProgressPublished       SituationProgress = "published"
	SituationProgressClosing         SituationProgress = "closing"
	SituationProgressClosed          SituationProgress = "closed"
)

func (*SituationProgress) FromString

func (progress *SituationProgress) FromString(s string) error

type SituationReality

type SituationReality string
const (
	SituationRealityReal              SituationReality = "real"
	SituationRealitySecurityExercise  SituationReality = "securityExercise"
	SituationRealityTechnicalExercise SituationReality = "technicalExercise"
	SituationRealityTest              SituationReality = "test"
)

func (*SituationReality) FromString

func (reality *SituationReality) FromString(s string) error

type SituationScopeType

type SituationScopeType string
const (
	SituationScopeTypeGeneral        SituationScopeType = "general"
	SituationScopeTypeOperator       SituationScopeType = "operator"
	SituationScopeTypeNetwork        SituationScopeType = "network"
	SituationScopeTypeRoute          SituationScopeType = "route"
	SituationScopeTypeLine           SituationScopeType = "line"
	SituationScopeTypePlace          SituationScopeType = "place"
	SituationScopeTypeStopPlace      SituationScopeType = "stopPlace"
	SituationScopeTypeStopPoint      SituationScopeType = "stopPoint"
	SituationScopeTypeVehicleJourney SituationScopeType = "VehicleJourney"
)

func (*SituationScopeType) FromString

func (sc *SituationScopeType) FromString(s string) error

type SituationSeverity

type SituationSeverity string
const (
	SituationSeverityNoImpact   SituationSeverity = "noImpact"
	SituationSeverityVerySlight SituationSeverity = "verySlight"
	SituationSeveritySlight     SituationSeverity = "slight"
	SituationSeverityNormal     SituationSeverity = "normal"
	SituationSeveritySevere     SituationSeverity = "severe"
	SituationSeverityUndefinded SituationSeverity = "undefined"
	SituationSeverityUnknown    SituationSeverity = "unknown"
	SituationSeverityVerySevere SituationSeverity = "verySevere"
)

func (*SituationSeverity) FromProto

func (s *SituationSeverity) FromProto(value interface{}) error

func (*SituationSeverity) FromString

func (severity *SituationSeverity) FromString(s string) error

func (SituationSeverity) ToProto

func (s SituationSeverity) ToProto(dest interface{}) error

type SituationType

type SituationType string

type SituationUpdateEvent

type SituationUpdateEvent struct {
	CreatedAt     time.Time
	RecordedAt    time.Time
	SituationCode Code

	Origin                  string
	Format                  string
	ProducerRef             string
	ParticipantRef          string
	VersionedAt             time.Time
	ValidityPeriods         []*TimeRange
	PublicationWindows      []*TimeRange
	Keywords                []string
	InternalTags            []string
	AlertCause              SituationAlertCause
	Progress                SituationProgress
	Reality                 SituationReality
	Severity                SituationSeverity
	ReportType              ReportType
	Version                 int
	Summary                 *TranslatedString
	Description             *TranslatedString
	Affects                 []Affect
	Consequences            []*Consequence
	PublishToWebActions     []*PublishToWebAction
	PublishToMobileActions  []*PublishToMobileAction
	PublishToDisplayActions []*PublishToDisplayAction
	InfoLinks               []*InfoLink
	// contains filtered or unexported fields
}

func (*SituationUpdateEvent) EventKind

func (ue *SituationUpdateEvent) EventKind() EventKind

func (*SituationUpdateEvent) Id

func (*SituationUpdateEvent) SetId

func (*SituationUpdateEvent) TestFindAffectByLineId

func (event *SituationUpdateEvent) TestFindAffectByLineId(lineId LineId) (bool, *AffectedLine)

func (*SituationUpdateEvent) TestFindAffectByStopAreaId

func (event *SituationUpdateEvent) TestFindAffectByStopAreaId(stopAreaId StopAreaId) (bool, *AffectedStopArea)

type SituationUpdateRequestId

type SituationUpdateRequestId string

type Situations

type Situations interface {
	uuid.UUIDInterface

	New() Situation
	Find(id SituationId) (Situation, bool)
	FindByCode(code Code) (Situation, bool)
	FindAll() []Situation
	Save(situation *Situation) bool
	Delete(situation *Situation) bool
}

type StatusUpdateEvent

type StatusUpdateEvent struct {
	StopAreaId StopAreaId
	Partner    string
	Status     bool
}

func NewStatusUpdateEvent

func NewStatusUpdateEvent(stopAreaId StopAreaId, partner string, status bool) *StatusUpdateEvent

func (*StatusUpdateEvent) EventKind

func (ue *StatusUpdateEvent) EventKind() EventKind

type StopArea

type StopArea struct {
	Collectable
	CollectedUntil time.Time

	References References
	CodeConsumer
	Origins    *StopAreaOrigins
	Attributes Attributes
	ReferentId StopAreaId `json:",omitempty"`

	ParentId          StopAreaId `json:",omitempty"`
	Name              string
	LineIds           StopAreaLineIds `json:"Lines,omitempty"`
	Latitude          float64         `json:",omitempty"`
	Longitude         float64         `json:",omitempty"`
	CollectChildren   bool
	CollectSituations bool
	CollectedAlways   bool
	Monitored         bool
	// contains filtered or unexported fields
}

func NewStopArea

func NewStopArea(model Model) *StopArea

func (*StopArea) Attribute

func (stopArea *StopArea) Attribute(key string) (value string, present bool)

func (*StopArea) Id

func (stopArea *StopArea) Id() StopAreaId

func (*StopArea) Lines

func (stopArea *StopArea) Lines() []*Line

func (*StopArea) MarshalJSON

func (stopArea *StopArea) MarshalJSON() ([]byte, error)

func (*StopArea) Parent

func (stopArea *StopArea) Parent() (*StopArea, bool)

func (*StopArea) Reference

func (stopArea *StopArea) Reference(key string) (Reference, bool)

func (*StopArea) Referent

func (stopArea *StopArea) Referent() (*StopArea, bool)

func (*StopArea) ReferentOrSelfCode

func (stopArea *StopArea) ReferentOrSelfCode(codeSpace string) (Code, bool)

func (*StopArea) Save

func (stopArea *StopArea) Save() bool

func (*StopArea) SetPartnerStatus

func (stopArea *StopArea) SetPartnerStatus(partner string, status bool)

func (*StopArea) UnmarshalJSON

func (stopArea *StopArea) UnmarshalJSON(data []byte) error

type StopAreaGroup

type StopAreaGroup struct {
	Name        string       `json:",omitempty"`
	ShortName   string       `json:",omitempty"`
	StopAreaIds []StopAreaId `json:",omitempty"`
	// contains filtered or unexported fields
}

func NewStopAreaGroup

func NewStopAreaGroup(model Model) *StopAreaGroup

func (*StopAreaGroup) Id

func (stopAreaGroup *StopAreaGroup) Id() StopAreaGroupId

func (*StopAreaGroup) MarshalJSON

func (stopAreaGroup *StopAreaGroup) MarshalJSON() ([]byte, error)

func (*StopAreaGroup) Save

func (stopAreaGroup *StopAreaGroup) Save() bool

type StopAreaGroupId

type StopAreaGroupId ModelId

type StopAreaGroups

type StopAreaGroups interface {
	uuid.UUIDInterface

	New() *StopAreaGroup

	Find(StopAreaGroupId) (*StopAreaGroup, bool)
	FindByShortName(string) (*StopAreaGroup, bool)
	FindAll() []*StopAreaGroup
	Save(*StopAreaGroup) bool
	Delete(*StopAreaGroup) bool
}

type StopAreaId

type StopAreaId ModelId

type StopAreaLineIds

type StopAreaLineIds []LineId

func (*StopAreaLineIds) Add

func (ids *StopAreaLineIds) Add(id LineId)

func (StopAreaLineIds) Contains

func (ids StopAreaLineIds) Contains(id LineId) bool

func (StopAreaLineIds) Copy

func (ids StopAreaLineIds) Copy() (t StopAreaLineIds)

type StopAreaOrigins

type StopAreaOrigins struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStopAreaOrigins

func NewStopAreaOrigins() *StopAreaOrigins

func (*StopAreaOrigins) AllOrigin

func (origins *StopAreaOrigins) AllOrigin() map[string]bool

func (*StopAreaOrigins) Copy

func (origins *StopAreaOrigins) Copy() *StopAreaOrigins

func (*StopAreaOrigins) MarshalJSON

func (origins *StopAreaOrigins) MarshalJSON() ([]byte, error)

func (*StopAreaOrigins) Monitored

func (origins *StopAreaOrigins) Monitored() (monitored bool)

func (*StopAreaOrigins) NewOrigin

func (origins *StopAreaOrigins) NewOrigin(partner string)

func (*StopAreaOrigins) Origin

func (origins *StopAreaOrigins) Origin(partner string) (status bool, present bool)

func (*StopAreaOrigins) PartnersKO

func (origins *StopAreaOrigins) PartnersKO() (partnersSlice []string)

func (*StopAreaOrigins) PartnersLost

func (origins *StopAreaOrigins) PartnersLost(comparedOrigins *StopAreaOrigins) (partnersLost []string, r bool)

func (*StopAreaOrigins) SetOriginsFromMap

func (origins *StopAreaOrigins) SetOriginsFromMap(originMap map[string]bool)

func (*StopAreaOrigins) SetPartnerStatus

func (origins *StopAreaOrigins) SetPartnerStatus(partner string, status bool)

type StopAreaUpdateEvent

type StopAreaUpdateEvent struct {
	Origin string

	Code            Code
	ParentCode      Code
	Name            string
	CollectedAlways bool
	Longitude       float64
	Latitude        float64
}

func NewStopAreaUpdateEvent

func NewStopAreaUpdateEvent() *StopAreaUpdateEvent

func (*StopAreaUpdateEvent) EventKind

func (ue *StopAreaUpdateEvent) EventKind() EventKind

type StopAreas

type StopAreas interface {
	uuid.UUIDInterface

	New() *StopArea
	Find(StopAreaId) (*StopArea, bool)
	FindByCode(Code) (*StopArea, bool)
	FindByLineId(LineId) []*StopArea
	FindByOrigin(string) []StopAreaId
	FindAll() []*StopArea
	FindAllValues() []StopArea
	FindFamily(StopAreaId) []StopAreaId
	FindByReferentId(StopAreaId) []*StopArea
	FindAscendants(StopAreaId) []*StopArea
	FindAscendantsWithCodeSpace(StopAreaId, string) []Code
	Save(*StopArea) bool
	Delete(*StopArea) bool
}

type StopMonitoringBroadcastEvent

type StopMonitoringBroadcastEvent struct {
	SubscriptionId string
	ModelId        string
	ModelType      string
}

type StopVisit

type StopVisit struct {
	RecordedAt time.Time

	References References
	Attributes Attributes
	Schedules  *schedules.StopVisitSchedules
	CodeConsumer
	VehicleJourneyId VehicleJourneyId         `json:",omitempty"`
	StopAreaId       StopAreaId               `json:",omitempty"`
	ArrivalStatus    StopVisitArrivalStatus   `json:",omitempty"`
	DepartureStatus  StopVisitDepartureStatus `json:",omitempty"`
	DataFrameRef     string                   `json:",omitempty"`

	Origin       string
	PassageOrder int `json:",omitempty"`

	VehicleAtStop bool
	// contains filtered or unexported fields
}

func NewStopVisit

func NewStopVisit(model Model) *StopVisit

func (*StopVisit) Attribute

func (stopVisit *StopVisit) Attribute(key string) (string, bool)

func (*StopVisit) Collected

func (stopVisit *StopVisit) Collected(t time.Time)

func (*StopVisit) CollectedAt

func (stopVisit *StopVisit) CollectedAt() time.Time

func (*StopVisit) Id

func (stopVisit *StopVisit) Id() StopVisitId

func (*StopVisit) IsArchivable

func (stopVisit *StopVisit) IsArchivable() bool

func (*StopVisit) IsCollected

func (stopVisit *StopVisit) IsCollected() bool

func (*StopVisit) IsRecordable

func (stopVisit *StopVisit) IsRecordable(now time.Time) bool

func (*StopVisit) MarshalJSON

func (stopVisit *StopVisit) MarshalJSON() ([]byte, error)

func (*StopVisit) NotCollected

func (stopVisit *StopVisit) NotCollected(notCollectedAt time.Time)

func (*StopVisit) Reference

func (stopVisit *StopVisit) Reference(key string) (Reference, bool)

func (*StopVisit) ReferenceArrivalTime

func (stopVisit *StopVisit) ReferenceArrivalTime() time.Time

func (*StopVisit) ReferenceDepartureTime

func (stopVisit *StopVisit) ReferenceDepartureTime() time.Time

func (*StopVisit) ReferenceTime

func (stopVisit *StopVisit) ReferenceTime() time.Time

func (*StopVisit) Save

func (stopVisit *StopVisit) Save() bool

func (*StopVisit) StopArea

func (stopVisit *StopVisit) StopArea() *StopArea

func (*StopVisit) UnmarshalJSON

func (stopVisit *StopVisit) UnmarshalJSON(data []byte) error

func (*StopVisit) VehicleJourney

func (stopVisit *StopVisit) VehicleJourney() *VehicleJourney

type StopVisitArchiver

type StopVisitArchiver struct {
	Model     Model
	StopVisit *StopVisit
}

func (*StopVisitArchiver) Archive

func (sva *StopVisitArchiver) Archive()

func (*StopVisitArchiver) StopArea

func (sva *StopVisitArchiver) StopArea() *StopArea

func (*StopVisitArchiver) VehicleJourney

func (sva *StopVisitArchiver) VehicleJourney() *VehicleJourney

type StopVisitArrivalStatus

type StopVisitArrivalStatus string
const (
	STOP_VISIT_ARRIVAL_ARRIVED      StopVisitArrivalStatus = "arrived"
	STOP_VISIT_ARRIVAL_ONTIME       StopVisitArrivalStatus = "onTime"
	STOP_VISIT_ARRIVAL_EARLY        StopVisitArrivalStatus = "early"
	STOP_VISIT_ARRIVAL_DELAYED      StopVisitArrivalStatus = "delayed"
	STOP_VISIT_ARRIVAL_CANCELLED    StopVisitArrivalStatus = "cancelled"
	STOP_VISIT_ARRIVAL_NOREPORT     StopVisitArrivalStatus = "noreport"
	STOP_VISIT_ARRIVAL_MISSED       StopVisitArrivalStatus = "missed"
	STOP_VISIT_ARRIVAL_NOT_EXPECTED StopVisitArrivalStatus = "notExpected"
)

func SetStopVisitArrivalStatus

func SetStopVisitArrivalStatus(arrivalStatus string) StopVisitArrivalStatus

func (StopVisitArrivalStatus) Arrived

func (svas StopVisitArrivalStatus) Arrived() bool

type StopVisitDepartureStatus

type StopVisitDepartureStatus string
const (
	STOP_VISIT_DEPARTURE_ONTIME    StopVisitDepartureStatus = "onTime"
	STOP_VISIT_DEPARTURE_EARLY     StopVisitDepartureStatus = "early"
	STOP_VISIT_DEPARTURE_DELAYED   StopVisitDepartureStatus = "delayed"
	STOP_VISIT_DEPARTURE_CANCELLED StopVisitDepartureStatus = "cancelled"
	STOP_VISIT_DEPARTURE_NOREPORT  StopVisitDepartureStatus = "noreport"
	STOP_VISIT_DEPARTURE_DEPARTED  StopVisitDepartureStatus = "departed"
)

func SetStopVisitDepartureStatus

func SetStopVisitDepartureStatus(departureStatus string) StopVisitDepartureStatus

func (StopVisitDepartureStatus) Departed

func (svds StopVisitDepartureStatus) Departed() bool

type StopVisitId

type StopVisitId ModelId

type StopVisitSelector

type StopVisitSelector func(*StopVisit) bool

func CompositeStopVisitSelector

func CompositeStopVisitSelector(selectors []StopVisitSelector) StopVisitSelector

func StopVisitSelectByStopAreaId

func StopVisitSelectByStopAreaId(stopAreaId StopAreaId) StopVisitSelector

func StopVisitSelectorAfterTime

func StopVisitSelectorAfterTime(startTime time.Time) StopVisitSelector

func StopVisitSelectorBeforeTime

func StopVisitSelectorBeforeTime(endTime time.Time) StopVisitSelector

func StopVisitSelectorByLines

func StopVisitSelectorByLines(lineIds []LineId) StopVisitSelector

func StopVisitSelectorByTime

func StopVisitSelectorByTime(startTime, endTime time.Time) StopVisitSelector

type StopVisitUpdateEvent

type StopVisitUpdateEvent struct {
	RecordedAt time.Time
	Schedules  *schedules.StopVisitSchedules

	SiriXML *sxml.XMLMonitoredStopVisit

	VehicleJourneyCode Code
	StopAreaCode       Code
	Code               Code
	CodeSpace          string
	DepartureStatus    StopVisitDepartureStatus
	ArrivalStatus      StopVisitArrivalStatus
	DataFrameRef       string
	Origin             string
	PassageOrder       int
	Monitored          bool
	VehicleAtStop      bool
	// contains filtered or unexported fields
}

func NewStopVisitUpdateEvent

func NewStopVisitUpdateEvent() *StopVisitUpdateEvent

func (*StopVisitUpdateEvent) Attributes

func (ue *StopVisitUpdateEvent) Attributes() Attributes

func (*StopVisitUpdateEvent) EventKind

func (ue *StopVisitUpdateEvent) EventKind() EventKind

func (*StopVisitUpdateEvent) References

func (ue *StopVisitUpdateEvent) References() References

type StopVisits

type StopVisits interface {
	uuid.UUIDInterface

	New() *StopVisit
	Find(StopVisitId) (*StopVisit, bool)
	FindByCode(Code) (*StopVisit, bool)
	FindByVehicleJourneyId(VehicleJourneyId) []*StopVisit
	FindByVehicleJourneyIdAndStopVisitOrder(VehicleJourneyId, int) *StopVisit
	VehicleJourneyHasStopVisits(VehicleJourneyId) bool
	FindByVehicleJourneyIdAfter(VehicleJourneyId, time.Time) []*StopVisit
	FindFollowingByVehicleJourneyId(VehicleJourneyId) []*StopVisit
	StopVisitsLenByVehicleJourney(VehicleJourneyId) int
	FindByStopAreaId(StopAreaId) []*StopVisit
	FindMonitoredByOriginByStopAreaId(StopAreaId, string) []*StopVisit
	FindFollowingByStopAreaId(StopAreaId) []*StopVisit
	FindFollowingByStopAreaIds([]StopAreaId) []*StopVisit
	FindAll() []*StopVisit
	UnsafeFindAll() []*StopVisit
	FindByVehicleJourneyIdAndStopAreaId(VehicleJourneyId, StopAreaId) []StopVisitId
	FindAllAfter(time.Time) []*StopVisit
	Save(*StopVisit) bool
	Delete(*StopVisit) bool
	DeleteMultiple([]*StopVisit) bool
}

type TimeRange

type TimeRange struct {
	StartTime time.Time
	EndTime   time.Time
}

func (*TimeRange) FromProto

func (t *TimeRange) FromProto(value interface{}) error

func (*TimeRange) MarshalJSON

func (t *TimeRange) MarshalJSON() ([]byte, error)

func (*TimeRange) ToProto

func (t *TimeRange) ToProto(dest interface{}) error

func (*TimeRange) UnmarshalJSON

func (t *TimeRange) UnmarshalJSON(data []byte) error

type TranslatedString

type TranslatedString struct {
	DefaultValue string            `json:",omitempty"`
	Translations map[string]string `json:",omitempty"`
}

func NewTranslatedStringFromMap

func NewTranslatedStringFromMap(translations map[string]string) *TranslatedString

func NewTranslatedStringFromProto

func NewTranslatedStringFromProto(value []*gtfs.TranslatedString_Translation) *TranslatedString

func (*TranslatedString) ToProto

func (ts *TranslatedString) ToProto(dest *gtfs.TranslatedString)

type UpdateEvent

type UpdateEvent interface {
	EventKind() EventKind
}

type UpdateManager

type UpdateManager struct {
	clock.ClockConsumer
	uuid.UUIDConsumer
	// contains filtered or unexported fields
}

func (*UpdateManager) Update

func (manager *UpdateManager) Update(event UpdateEvent)

type Vehicle

type Vehicle struct {
	RecordedAtTime time.Time
	ValidUntilTime time.Time `json:",omitempty"`

	CodeConsumer
	Attributes       Attributes
	StopAreaId       StopAreaId       `json:",omitempty"`
	Occupancy        string           `json:",omitempty"`
	LineId           LineId           `json:",omitempty"`
	VehicleJourneyId VehicleJourneyId `json:",omitempty"`
	DriverRef        string           `json:",omitempty"`

	NextStopVisitId StopVisitId `json:",omitempty"`
	LinkDistance    float64     `json:",omitempty"`
	Percentage      float64     `json:",omitempty"`
	Longitude       float64     `json:",omitempty"`
	Latitude        float64     `json:",omitempty"`
	Bearing         float64     `json:",omitempty"`
	// contains filtered or unexported fields
}

func NewVehicle

func NewVehicle(model Model) *Vehicle

func (*Vehicle) Id

func (vehicle *Vehicle) Id() VehicleId

func (*Vehicle) MarshalJSON

func (vehicle *Vehicle) MarshalJSON() ([]byte, error)

func (*Vehicle) Save

func (vehicle *Vehicle) Save() bool

func (*Vehicle) UnmarshalJSON

func (vehicle *Vehicle) UnmarshalJSON(data []byte) error

func (*Vehicle) VehicleJourney

func (vehicle *Vehicle) VehicleJourney() *VehicleJourney

type VehicleBroadcastEvent

type VehicleBroadcastEvent struct {
	SubscriptionId string
	ModelId        string
	ModelType      string
}

type VehicleId

type VehicleId ModelId

type VehicleJourney

type VehicleJourney struct {
	References References

	Attributes Attributes
	CodeConsumer
	LineId LineId `json:",omitempty"`
	Name   string `json:",omitempty"`

	DestinationName         string `json:",omitempty"`
	Occupancy               string `json:",omitempty"`
	DirectionType           string `json:",omitempty"`
	Origin                  string `json:",omitempty"`
	OriginName              string `json:",omitempty"`
	Monitored               bool
	HasCompleteStopSequence bool
	// contains filtered or unexported fields
}

func NewVehicleJourney

func NewVehicleJourney(model Model) *VehicleJourney

func (*VehicleJourney) Attribute

func (vehicleJourney *VehicleJourney) Attribute(key string) (string, bool)

func (*VehicleJourney) Id

func (vehicleJourney *VehicleJourney) Id() VehicleJourneyId

func (*VehicleJourney) Line

func (vehicleJourney *VehicleJourney) Line() *Line

func (*VehicleJourney) MarshalJSON

func (vehicleJourney *VehicleJourney) MarshalJSON() ([]byte, error)

func (*VehicleJourney) Reference

func (vehicleJourney *VehicleJourney) Reference(key string) (Reference, bool)

func (*VehicleJourney) Save

func (vehicleJourney *VehicleJourney) Save() bool

func (*VehicleJourney) ToFormat

func (vehicleJourney *VehicleJourney) ToFormat() []string

func (*VehicleJourney) UnmarshalJSON

func (vehicleJourney *VehicleJourney) UnmarshalJSON(data []byte) error

type VehicleJourneyId

type VehicleJourneyId ModelId

type VehicleJourneyUpdateEvent

type VehicleJourneyUpdateEvent struct {
	SiriXML *sxml.XMLMonitoredVehicleJourney

	Code            Code
	LineCode        Code
	Direction       string
	DestinationName string
	DestinationRef  string
	DirectionType   string
	Occupancy       string
	OriginName      string
	CodeSpace       string
	OriginRef       string
	Origin          string
	Monitored       bool
	// contains filtered or unexported fields
}

func NewVehicleJourneyUpdateEvent

func NewVehicleJourneyUpdateEvent() *VehicleJourneyUpdateEvent

func (*VehicleJourneyUpdateEvent) Attributes

func (ue *VehicleJourneyUpdateEvent) Attributes() Attributes

func (*VehicleJourneyUpdateEvent) EventKind

func (ue *VehicleJourneyUpdateEvent) EventKind() EventKind

func (*VehicleJourneyUpdateEvent) References

func (ue *VehicleJourneyUpdateEvent) References() References

type VehicleJourneys

type VehicleJourneys interface {
	uuid.UUIDInterface

	New() *VehicleJourney
	Find(VehicleJourneyId) (*VehicleJourney, bool)
	FindByCode(code Code) (*VehicleJourney, bool)
	FindByLineId(LineId) []*VehicleJourney
	FullVehicleJourneyExistBySubscriptionId(string, VehicleJourneyId) bool
	FindAll() []*VehicleJourney
	Save(*VehicleJourney) bool
	SetFullVehicleJourneyBySubscriptionId(string, VehicleJourneyId)
	Delete(*VehicleJourney) bool
	DeleteById(VehicleJourneyId) bool
}

type VehicleUpdateEvent

type VehicleUpdateEvent struct {
	ValidUntilTime     time.Time
	RecordedAt         time.Time
	Code               Code
	StopAreaCode       Code
	VehicleJourneyCode Code
	Occupancy          string
	DriverRef          string
	Origin             string
	Longitude          float64
	Latitude           float64
	Bearing            float64
	Percentage         float64
	LinkDistance       float64
	NextStopPointOrder int
}

func NewVehicleUpdateEvent

func NewVehicleUpdateEvent() *VehicleUpdateEvent

func (*VehicleUpdateEvent) EventKind

func (ue *VehicleUpdateEvent) EventKind() EventKind

type Vehicles

type Vehicles interface {
	uuid.UUIDInterface

	New() *Vehicle
	Find(VehicleId) (*Vehicle, bool)
	FindByCode(Code) (*Vehicle, bool)
	FindByLineId(LineId) []*Vehicle
	FindByNextStopVisitId(StopVisitId) (*Vehicle, bool)
	FindAll() []*Vehicle
	Save(*Vehicle) bool
	Delete(*Vehicle) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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