Documentation ¶
Index ¶
- Constants
- func CreateDeviceRelationshipFromDevice(device string) *ngsi.SingleObjectRelationship
- func NewDeviceModelRelationship(deviceModelID string) (*ngsi.SingleObjectRelationship, error)
- type AirQualityObserved
- func (aqo AirQualityObserved) ToGeoJSONFeature(propertyName string, simplified bool) (geojson.GeoJSONFeature, error)
- func (aqo *AirQualityObserved) UnmarshalJSON(data []byte) error
- func (aqo AirQualityObserved) WithCO2(value float64) *AirQualityObserved
- func (aqo AirQualityObserved) WithRelativeHumidity(value float64) *AirQualityObserved
- func (aqo AirQualityObserved) WithTemperature(value float64) *AirQualityObserved
- type Beach
- type CityWork
- type Device
- type DeviceModel
- type Open311ServiceRequest
- type Open311ServiceType
- type Road
- type RoadAccident
- type RoadSegment
- type RoadSurfaceType
- type TrafficFlowObserved
- type WCONumberProperty
- type WCOTextProperty
- type WaterConsumptionObserved
- type WaterQualityObserved
- type WeatherObserved
Constants ¶
const ( //AirQualityObservedTypeName is a type name constant for AirQualityObserved AirQualityObservedTypeName string = "AirQualityObserved" //AirQualityObservedIDPrefix contains the mandatory prefix for AirQualityObserved ID:s AirQualityObservedIDPrefix string = urnPrefix + AirQualityObservedTypeName + ":" //BeachTypeName is a type name constant for Beach BeachTypeName string = "Beach" //BeachIDPrefix contains the mandatory prefix for Beach ID:s BeachIDPrefix string = urnPrefix + BeachTypeName + ":" //CityWorkTypeName is a type name constant for CityWork CityWorkTypeName string = "CityWork" //CityWorkIDPrefix contains the mandatory prefix for CityWork ID:s CityWorkIDPrefix string = urnPrefix + CityWorkTypeName + ":" //DeviceTypeName is a type name constant for Device DeviceTypeName string = "Device" //DeviceIDPrefix contains the mandatory prefix for Device ID:s DeviceIDPrefix string = urnPrefix + DeviceTypeName + ":" //DeviceModelTypeName is a type name constant for DeviceModel DeviceModelTypeName string = "DeviceModel" //DeviceModelIDPrefix contains the mandatory prefix for DeviceModel ID:s DeviceModelIDPrefix string = urnPrefix + DeviceModelTypeName + ":" //Open311ServiceRequestTypeName is a type name constant for Open311ServiceRequest Open311ServiceRequestTypeName string = "Open311ServiceRequest" //Open311ServiceRequestIDPrefix ... Open311ServiceRequestIDPrefix string = urnPrefix + Open311ServiceRequestTypeName + ":" //Open311ServiceTypeTypeName is a type name constant for Open311ServiceType Open311ServiceTypeTypeName string = "Open311ServiceType" //Open311ServiceTypeIDPrefix ... Open311ServiceTypeIDPrefix string = urnPrefix + Open311ServiceTypeTypeName + ":" //PointOfInterestTypeName is a type name constant for PointOfInterest PointOfInterestTypeName string = "PointOfInterest" //PointOfInterestIDPrefix contains the mandatory prefix for PointOfInterest ID:s PointOfInterestIDPrefix string = urnPrefix + PointOfInterestTypeName + ":" //RoadTypeName is a type name constant for Road RoadTypeName string = "Road" //RoadIDPrefix ... RoadIDPrefix string = urnPrefix + RoadTypeName + ":" //RoadAccident is a type name constant for RoadAccident RoadAccidentTypeName string = "RoadAccident" //RoadAccidentIDPrefix... RoadAccidentIDPrefix string = urnPrefix + RoadAccidentTypeName + ":" //RoadSegmentTypeName is a type name constant for RoadSegment RoadSegmentTypeName string = "RoadSegment" //RoadSegmentIDPrefix ... RoadSegmentIDPrefix string = urnPrefix + RoadSegmentTypeName + ":" //TrafficFlowObservedTypeName is a type name constant for TrafficFlowObserved TrafficFlowObservedTypeName string = "TrafficFlowObserved" //TrafficFlowObserved ... TrafficFlowObservedIDPrefix string = urnPrefix + TrafficFlowObservedTypeName + ":" //WaterConsumptionObservedTypeName is a type name constant for WaterConsumptionObserved WaterConsumptionObservedTypeName string = "WaterConsumptionObserved" //WaterConsumptionObservedIDPrefix ... WaterConsumptionObservedIDPrefix string = urnPrefix + WaterConsumptionObservedTypeName + ":" //WaterQualityObservedTypeName is a type name constant for WaterQualityObserved WaterQualityObservedTypeName string = "WaterQualityObserved" //WaterQualityObservedIDPrefix ... WaterQualityObservedIDPrefix string = urnPrefix + WaterQualityObservedTypeName + ":" //WeatherObservedTypeName is a type name constant for WeatherObserved WeatherObservedTypeName string = "WeatherObserved" //WeatherObservedIDPrefix ... WeatherObservedIDPrefix string = urnPrefix + WeatherObservedTypeName + ":" )
Variables ¶
This section is empty.
Functions ¶
func CreateDeviceRelationshipFromDevice ¶
func CreateDeviceRelationshipFromDevice(device string) *ngsi.SingleObjectRelationship
CreateDeviceRelationshipFromDevice create a DeviceRelationship from a Device
func NewDeviceModelRelationship ¶
func NewDeviceModelRelationship(deviceModelID string) (*ngsi.SingleObjectRelationship, error)
NewDeviceModelRelationship creates a single object relationship to a DeviceModelID
Types ¶
type AirQualityObserved ¶
type AirQualityObserved struct { ngsi.BaseEntity DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` DateObserved ngsi.TextProperty `json:"dateObserved"` Location geojson.GeoJSONProperty `json:"location"` RefDevice *ngsi.SingleObjectRelationship `json:"refDevice,omitempty"` RefPointOfInterest *ngsi.SingleObjectRelationship `json:"refPointOfInterest,omitempty"` AreaServed *ngsi.TextProperty `json:"areaServed,omitempty"` Temperature *ngsi.NumberProperty `json:"temperature,omitempty"` CO2 *ngsi.NumberProperty `json:"CO2,omitempty"` RelativeHumidity *ngsi.NumberProperty `json:"relativeHumidity,omitempty"` }
AirQualityObserved is intended to represent an observation of air quality conditions at a certain place and time.
func NewAirQualityObserved ¶
func NewAirQualityObserved(device string, latitude float64, longitude float64, observedAt string) *AirQualityObserved
NewAirQualityObserved creates a new instance of AirQualityObserved
func (AirQualityObserved) ToGeoJSONFeature ¶
func (aqo AirQualityObserved) ToGeoJSONFeature(propertyName string, simplified bool) (geojson.GeoJSONFeature, error)
func (*AirQualityObserved) UnmarshalJSON ¶
func (aqo *AirQualityObserved) UnmarshalJSON(data []byte) error
func (AirQualityObserved) WithCO2 ¶
func (aqo AirQualityObserved) WithCO2(value float64) *AirQualityObserved
func (AirQualityObserved) WithRelativeHumidity ¶
func (aqo AirQualityObserved) WithRelativeHumidity(value float64) *AirQualityObserved
func (AirQualityObserved) WithTemperature ¶
func (aqo AirQualityObserved) WithTemperature(value float64) *AirQualityObserved
type Beach ¶
type Beach struct { ngsi.BaseEntity Name *ngsi.TextProperty `json:"name,omitempty"` Description *ngsi.TextProperty `json:"description"` Location geojson.GeoJSONGeometry `json:"location,omitempty"` RefSeeAlso *ngsi.MultiObjectRelationship `json:"refSeeAlso,omitempty"` SameAs *ngsi.TextProperty `json:"sameAs,omitempty"` WaterTemperature *ngsi.NumberProperty `json:"waterTemperature,omitempty"` DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` }
Beach is a Fiware entity
func NewBeach ¶
func NewBeach(id, name string, location geojson.GeoJSONGeometry) *Beach
NewBeach creates a new Beach from given ID and name
func (Beach) ToGeoJSONFeature ¶
func (*Beach) UnmarshalJSON ¶
func (*Beach) WithDescription ¶
WithDescription adds a text property named Deescription to this Beach instance
type CityWork ¶
type CityWork struct { ngsitypes.BaseEntity Location *geojson.GeoJSONProperty `json:"location,omitempty"` Description *ngsitypes.TextProperty `json:"description,omitempty"` DateCreated ngsitypes.DateTimeProperty `json:"dateCreated"` DateModified *ngsitypes.DateTimeProperty `json:"dateModified,omitempty"` EndDate ngsitypes.DateTimeProperty `json:"endDate"` StartDate ngsitypes.DateTimeProperty `json:"startDate"` }
func NewCityWork ¶
type Device ¶
type Device struct { ngsi.BaseEntity Value *ngsi.TextProperty `json:"value,omitempty"` DateLastValueReported *ngsi.DateTimeProperty `json:"dateLastValueReported,omitempty"` DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` Location *geojson.GeoJSONProperty `json:"location,omitempty"` RefDeviceModel *ngsi.SingleObjectRelationship `json:"refDeviceModel,omitempty"` DeviceState *ngsi.TextProperty `json:"deviceState,omitempty"` }
Device is a Fiware entity
func (*Device) UnmarshalJSON ¶
type DeviceModel ¶
type DeviceModel struct { ngsi.BaseEntity Category *ngsi.TextListProperty `json:"category"` ModelName *ngsi.TextProperty `json:"modelName,omitempty"` Name *ngsi.TextProperty `json:"name,omitempty"` BrandName *ngsi.TextProperty `json:"brandName,omitempty"` ManufacturerName *ngsi.TextProperty `json:"manufacturerName,omitempty"` ControlledProperty *ngsi.TextListProperty `json:"controlledProperty,omitempty"` DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` }
DeviceModel is a Fiware entity
func NewDeviceModel ¶
func NewDeviceModel(id string, categories []string) *DeviceModel
NewDeviceModel creates a new DeviceModel from given ID and Value
type Open311ServiceRequest ¶
type Open311ServiceRequest struct { ngsi.BaseEntity RequestedDateTime *ngsi.DateTimeProperty `json:"requested_datetime,omitempty"` Location geojson.GeoJSONProperty `json:"location"` ServiceCode ngsi.NumberProperty `json:"service_code"` }
Open311ServiceRequest is a ...
func NewOpen311ServiceRequest ¶
func NewOpen311ServiceRequest(latitude float64, longitude float64, reportedType int, reportedTimestamp string) *Open311ServiceRequest
NewOpen311ServiceRequest creates a new service request
type Open311ServiceType ¶
type Open311ServiceType struct { ngsi.BaseEntity Description ngsi.TextProperty `json:"description"` ServiceCode ngsi.NumberProperty `json:"service_code"` }
Open311ServiceType is a ...
func NewOpen311ServiceType ¶
func NewOpen311ServiceType(label string, reportType string) *Open311ServiceType
NewOpen311ServiceType creates a new Open311ServiceType
type Road ¶
type Road struct { ngsi.BaseEntity Name *ngsi.TextProperty `json:"name"` RoadClass *ngsi.TextProperty `json:"roadClass"` RefRoadSegment ngsi.MultiObjectRelationship `json:"refRoadSegment"` }
Road is a Fiware entity
type RoadAccident ¶
type RoadAccident struct { ngsitypes.BaseEntity AccidentDate ngsitypes.DateTimeProperty `json:"accidentDate"` Location *geojson.GeoJSONProperty `json:"location,omitempty"` Description ngsitypes.TextProperty `json:"description,omitempty"` DateCreated ngsitypes.DateTimeProperty `json:"dateCreated"` DateModified *ngsitypes.DateTimeProperty `json:"dateModified,omitempty"` Status ngsitypes.TextProperty `json:"status"` }
func NewRoadAccident ¶
func NewRoadAccident(entityID string) *RoadAccident
type RoadSegment ¶
type RoadSegment struct { ngsi.BaseEntity Name *ngsi.TextProperty `json:"name"` DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` Location ngsi.RoadSegmentLocation `json:"location,omitempty"` EndPoint geojson.GeoJSONProperty `json:"endPoint"` StartPoint geojson.GeoJSONProperty `json:"startPoint"` RefRoad *ngsi.SingleObjectRelationship `json:"refRoad,omitempty"` TotalLaneNumber *ngsi.NumberProperty `json:"totalLaneNumber"` SurfaceType *RoadSurfaceType `json:"surfaceType,omitempty"` }
RoadSegment is a Fiware entity
func NewRoadSegment ¶
func NewRoadSegment(id, roadSegmentName, roadID string, coords [][2]float64, modified *time.Time) *RoadSegment
NewRoadSegment creates a new instance of RoadSegment
func (*RoadSegment) WithSurfaceType ¶
func (rs *RoadSegment) WithSurfaceType(surfaceType string, probability float64) *RoadSegment
WithSurfaceType takes a string surfaceType and a probability and returns the road segment instance
type RoadSurfaceType ¶
type RoadSurfaceType struct { ngsi.TextProperty Probability float64 `json:"probability"` }
RoadSurfaceType contains a surface type and a probability
type TrafficFlowObserved ¶
type TrafficFlowObserved struct { ngsi.BaseEntity DateObserved ngsi.TextProperty `json:"dateObserved"` DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` DateObservedTo *ngsi.DateTimeProperty `json:"dateObservedTo,omitempty"` DateObservedFrom *ngsi.DateTimeProperty `json:"dateObservedFrom,omitempty"` Location *geojson.GeoJSONProperty `json:"location,omitempty"` LaneID *ngsi.NumberProperty `json:"laneID"` AverageVehicleSpeed *ngsi.NumberProperty `json:"averageVehicleSpeed,omitempty"` Intensity *ngsi.NumberProperty `json:"intensity,omitempty"` RefRoadSegment *ngsi.SingleObjectRelationship `json:"refRoadSegment,omitempty"` }
TrafficFlowObserved is a Fiware entity
func NewTrafficFlowObserved ¶
func NewTrafficFlowObserved(id string, observedAt string, laneID int, intensity int) *TrafficFlowObserved
NewTrafficFlowObserved creates a new TrafficFlowObserved from given ID
func (*TrafficFlowObserved) UnmarshalJSON ¶
func (tfo *TrafficFlowObserved) UnmarshalJSON(data []byte) error
type WCONumberProperty ¶
type WCONumberProperty struct { ngsi.NumberProperty ObservedBy ngsi.SingleObjectRelationship `json:"observedBy,omitempty"` ObservedAt string `json:"observedAt,omitempty"` UnitCode string `json:"unitCode,omitempty"` }
type WCOTextProperty ¶
type WCOTextProperty struct { ngsi.TextProperty ObservedBy ngsi.SingleObjectRelationship `json:"observedBy,omitempty"` ObservedAt string `json:"observedAt,omitempty"` UnitCode string `json:"unitCode,omitempty"` }
type WaterConsumptionObserved ¶
type WaterConsumptionObserved struct { ngsi.BaseEntity AlarmFlowPersistence *WCOTextProperty `json:"alarmFlowPersistence,omitempty"` AlarmInProgress *WCONumberProperty `json:"alarmInProgress,omitempty"` AlarmMetrology *WCONumberProperty `json:"alarmMetrology,omitempty"` AlarmStopsLeaks *WCONumberProperty `json:"alarmStopsLeaks,omitempty"` AlarmSystem *WCONumberProperty `json:"alarmSystem,omitempty"` AlarmTamper *WCONumberProperty `json:"alarmTamper,omitempty"` AlarmWaterQuality *WCONumberProperty `json:"alarmWaterQuality,omitempty"` MaxFlow *WCONumberProperty `json:"maxFlow,omitempty"` MinFlow *WCONumberProperty `json:"minFlow,omitempty"` ModuleTampered *WCONumberProperty `json:"moduleTampered,omitempty"` PersistenceFlowDuration *WCOTextProperty `json:"persistenceFlowDuration,omitempty"` WaterConsumption *WCONumberProperty `json:"waterConsumption,omitempty"` Location *geojson.GeoJSONProperty `json:"location,omitempty"` }
WaterConsumptionObserved is a fiware entity
func NewWaterConsumptionObserved ¶
func NewWaterConsumptionObserved(id string) *WaterConsumptionObserved
NewWaterConsumptionObserved creates a new instance of WaterConsumptionObserved
func (*WaterConsumptionObserved) UnmarshalJSON ¶
func (wco *WaterConsumptionObserved) UnmarshalJSON(data []byte) error
func (*WaterConsumptionObserved) WithConsumption ¶
func (wco *WaterConsumptionObserved) WithConsumption(device string, consumption float64, observedAt time.Time) *WaterConsumptionObserved
type WaterQualityObserved ¶
type WaterQualityObserved struct { ngsi.BaseEntity DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` DateObserved ngsi.DateTimeProperty `json:"dateObserved"` Location geojson.GeoJSONProperty `json:"location"` RefDevice *ngsi.SingleObjectRelationship `json:"refDevice,omitempty"` RefPointOfInterest *ngsi.SingleObjectRelationship `json:"refPointOfInterest,omitempty"` Temperature *ngsi.NumberProperty `json:"temperature,omitempty"` }
WaterQualityObserved is intended to represent water quality parameters at a certain water mass (river, lake, sea, etc.) section.
func NewWaterQualityObserved ¶
func NewWaterQualityObserved(device string, latitude float64, longitude float64, observedAt string) *WaterQualityObserved
NewWaterQualityObserved creates a new instance of WaterQualityObserved
func (WaterQualityObserved) ToGeoJSONFeature ¶
func (wqo WaterQualityObserved) ToGeoJSONFeature(propertyName string, simplified bool) (geojson.GeoJSONFeature, error)
func (*WaterQualityObserved) UnmarshalJSON ¶
func (wqo *WaterQualityObserved) UnmarshalJSON(data []byte) error
type WeatherObserved ¶
type WeatherObserved struct { ngsi.BaseEntity DateCreated *ngsi.DateTimeProperty `json:"dateCreated,omitempty"` DateModified *ngsi.DateTimeProperty `json:"dateModified,omitempty"` DateObserved ngsi.DateTimeProperty `json:"dateObserved"` Location geojson.GeoJSONProperty `json:"location"` RefDevice *ngsi.SingleObjectRelationship `json:"refDevice,omitempty"` SnowHeight *ngsi.NumberProperty `json:"snowHeight,omitempty"` Temperature *ngsi.NumberProperty `json:"temperature,omitempty"` }
WeatherObserved is an observation of weather conditions at a certain place and time.
func NewWeatherObserved ¶
func NewWeatherObserved(device string, latitude float64, longitude float64, observedAt string) *WeatherObserved
NewWeatherObserved creates a new instance of WeatherObserved
func (WeatherObserved) ToGeoJSONFeature ¶
func (wo WeatherObserved) ToGeoJSONFeature(propertyName string, simplified bool) (geojson.GeoJSONFeature, error)
func (*WeatherObserved) UnmarshalJSON ¶
func (wo *WeatherObserved) UnmarshalJSON(data []byte) error