ngsi

package
v3.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: BSD-4-Clause Imports: 13 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	INFO     *log.Logger
	PROTOCOL *log.Logger
	ERROR    *log.Logger
	DEBUG    *log.Logger
)

Functions

func Distance

func Distance(p1 *Point, p2 *Point) uint64

Types

type BrokerProfile

type BrokerProfile struct {
	BID   string
	MyURL string
}

type CSourceRegistrationRequest

type CSourceRegistrationRequest struct {
	Id                  string             `json:"id",omitempty` //URI
	Type                string             `json:"type",omitemtpy`
	Name                string             `json:"name",omitempty`
	Description         string             `json:"description",omitempty`
	Information         []RegistrationInfo `json:"information",omitemtpy`
	ObservationInterval TimeInterval       `json:"observationInterval",omitempty`
	ManagementInterval  TimeInterval       `json:"managementInterval",omitempty`
	Location            string             `json:"location",omitempty`
	ObservationSpace    interface{}        `json:"observationSpace,omitempty"` // Type = GeoJSON Geometry
	OperationSpace      interface{}        `json:"operationSpace,omitempty"`   // Type = GeoJSON Geometry
	Expires             string             `json:expires,omitempty`
	Endpoint            string             `json:"endpoint",omitemtpy` //URI
	CreatedAt           string             `json:"createdAt",omitemtpy`
	ModifiedAt          string             `json:"modifiedAt",omitemtpy`
}

type CSourceRegistrationResponse

type CSourceRegistrationResponse struct {
	RegistrationID string     `json: "registrationID",omitemtpy`
	ErrorCode      StatusCode `json:"errorCode,omitempty",omitemtpy`
}

type Circle

type Circle struct {
	Latitude  float64 `json:"centerLatitude"`
	Longitude float64 `json:"centerLongitude"`
	Radius    float64 `json:"radius"`
}

type Conditions

type Conditions struct {
	Attrs      []string   `json:"attrs"`
	Expression Expression `json:"expression,omitempty"`
}

type ContextAttribute

type ContextAttribute struct {
	Name     string            `json:"name"`
	Type     string            `json:"type,omitempty"`
	Value    interface{}       `json:"value"`
	Metadata []ContextMetadata `json:"metadata,omitempty"`
}

func (*ContextAttribute) UnmarshalJSON

func (pAttr *ContextAttribute) UnmarshalJSON(b []byte) error

type ContextElement

type ContextElement struct {
	Entity     EntityId           `json:"entityId"`
	ID         string             `json:"id"`
	Type       string             `json:"type,omitempty"`
	IsPattern  string             `json:"isPattern"`
	Attributes []ContextAttribute `json:"attributes,omitempty"`
	Metadata   []ContextMetadata  `json:"domainMetadata,omitempty"`
}

func Object2CtxElement

func Object2CtxElement(ctxObj *ContextObject) *ContextElement

func (*ContextElement) CloneWithSelectedAttributes

func (ce *ContextElement) CloneWithSelectedAttributes(selectedAttributes []string) *ContextElement

func (*ContextElement) GetAttribute

func (ce *ContextElement) GetAttribute(name string) *ContextAttribute

func (*ContextElement) GetMetadata

func (ce *ContextElement) GetMetadata(name string) *ContextMetadata

func (*ContextElement) GetScope

func (ce *ContextElement) GetScope() OperationScope

func (*ContextElement) IsEmpty

func (ce *ContextElement) IsEmpty() bool

func (*ContextElement) MarshalJSON

func (element *ContextElement) MarshalJSON() ([]byte, error)

func (*ContextElement) SetEntityID

func (element *ContextElement) SetEntityID()

the part to deal with NGSI v1 update supported by Orion Context Broker

type ContextElementOrion

type ContextElementOrion struct {
	ID                  string                  `json:"id"`
	Type                string                  `json:"type"`
	IsPattern           string                  `json:"isPattern"`
	AttributeDomainName string                  `json:"attributeDomainName,omitempty"`
	Attributes          []OrionContextAttribute `json:"attributes,omitempty"`
	Metadatas           []ContextMetadata       `json:"metadatas,omitempty"`
}

type ContextElementResponse

type ContextElementResponse struct {
	ContextElement ContextElement `json:"contextElement"`
	StatusCode     StatusCode     `json:"statusCode"`
}

type ContextMetadata

type ContextMetadata struct {
	Name  string      `json:"name"`
	Type  string      `json:"type,omitempty"`
	Value interface{} `json:"value"`
}

func (*ContextMetadata) UnmarshalJSON

func (metadata *ContextMetadata) UnmarshalJSON(b []byte) error

type ContextObject

type ContextObject struct {
	Entity              EntityId               `json:"entityId"`
	Attributes          map[string]ValueObject `json:"attributes,omitempty"`
	Metadata            map[string]ValueObject `json:"metadata,omitempty"`
	AttributeDomainName string                 `json:"attributeDomainName,omitempty"`
}

func CtxElement2Object

func CtxElement2Object(ctxElem *ContextElement) *ContextObject

func (*ContextObject) IsEmpty

func (ctxObj *ContextObject) IsEmpty() bool

type ContextRegistration

type ContextRegistration struct {
	EntityIdList                  []EntityId                     `json:"entities,omitempty"`
	ContextRegistrationAttributes []ContextRegistrationAttribute `json:"attributes,omitempty"`
	Metadata                      []ContextMetadata              `json:"contextMetadata,omitempty"`
	ProvidingApplication          string                         `json:"providingApplication"`
}

type ContextRegistration1

type ContextRegistration1 struct {
	EntityIdList                  []EntityId1                    `json:"entities,omitempty"`
	ContextRegistrationAttributes []ContextRegistrationAttribute `json:"attributes,omitempty"`
	Metadata                      []ContextMetadata              `json:"contextMetadata,omitempty"`
	ProvidingApplication          string                         `json:"providingApplication"`
}

type ContextRegistrationAttribute

type ContextRegistrationAttribute struct {
	Name     string            `json:"name"`
	Type     string            `json:"type,omitempty"`
	IsDomain bool              `json:"isDomain"`
	Metadata []ContextMetadata `json:"metadata,omitempty"`
}

type ContextRegistrationResponse

type ContextRegistrationResponse struct {
	ContextRegistration ContextRegistration `json:"contextRegistration,omitempty"`
	ErrorCode           StatusCode          `json:"errorCode,omitempty"`
}

type DiscoverContextAvailabilityRequest

type DiscoverContextAvailabilityRequest struct {
	Entities    []EntityId  `json:"entities"`
	Attributes  []string    `json:"attributes,omitempty"`
	Restriction Restriction `json:"restriction,omitempty"`
}

type DiscoverContextAvailabilityResponse

type DiscoverContextAvailabilityResponse struct {
	ContextRegistrationResponses []ContextRegistrationResponse `json:"contextRegistrationResponses,omitempty"`
	ErrorCode                    StatusCode                    `json:"errorCode,omitempty"`
}

type Endpoint

type Endpoint struct {
	URI    string `json:"uri",omitemtpy` // URI
	Accept string `json:"accept",omitempty`
}

type EntityId

type EntityId struct {
	Type      string `json:"type,omitempty"`
	IsPattern bool   `json:"isPattern,omitempty"`
	ID        string `json:"id"`
	IdPattern string `json:"idPattern,omitempty"`
}

type EntityId1

type EntityId1 struct {
	ID        string `json:"id"`
	Type      string `json:"type,omitempty"`
	IsPattern string `json:"isPattern,omitempty"`
}

type EntityRegistration

type EntityRegistration struct {
	ID                   string
	Type                 string
	AttributesList       map[string]ContextRegistrationAttribute
	MetadataList         map[string]ContextMetadata
	ProvidingApplication string
}

func (*EntityRegistration) GetLocation

func (registredEntity *EntityRegistration) GetLocation() Point

func (*EntityRegistration) IsMatched

func (registredEntity *EntityRegistration) IsMatched(restrictions map[string]interface{}) bool

used by master to group the received input

func (*EntityRegistration) Update

func (registredEntity *EntityRegistration) Update(newUpdates *EntityRegistration)

type Expression

type Expression struct {
	Georel   map[string]ValueObject `json:"georel,omitempty"`
	Geometry map[string]ValueObject `json:"geometry,omitempty"`
	Coords   map[string]ValueObject `json:"coords,omitempty"`
}

type FiwareData

type FiwareData struct {
	ProviderIoTAgent  string
	FiwareService     string
	FiwareServicePath string
}

type GeoProperty

type GeoProperty struct {
	Type       string      `json:"type",omitemtpy`
	Value      interface{} `json:"value"omitemtpy`
	ObservedAt string      `json:"observedAt", omitemtpy`
	DatasetId  string      `json:"datasetId", omitempty` //URI

}

type GeoQuery

type GeoQuery struct {
	Geometry    string `json:"geometry",omitemtpy`
	Coordinates string `json:"coordinates",omitemtpy` // string or JSON Array
	GeoRel      string `json:"georel",omitemtpy`
	GeoProperty string `json:"geoproperty",omitempty`
}

type Geometry

type Geometry struct {
	Type        string      `json:"type",omitemtpy`
	Coordinates interface{} `json:"coordinates",omitemtpy`
}

type HTTPS

type HTTPS struct {
	Enabled     bool   `json:"enabled"`
	Certificate string `json:"my_certificate"`
	Key         string `json:"my_key"`
	CA          string `json:"my_ca"`
	// contains filtered or unexported fields
}

func (*HTTPS) GetHTTPClient

func (cfg *HTTPS) GetHTTPClient() *http.Client

func (*HTTPS) LoadConfig

func (cfg *HTTPS) LoadConfig() bool

type Http

type Http struct {
	Url string `json:"url"`
}

type LDContextElement

type LDContextElement struct {
	Id               string         `json:"id",omitemtpy`
	Type             string         `json:"type",omitemtpy`
	Properties       []Property     `json:"properties",omitempty`
	Relationships    []Relationship `json:"relationships",omitempty`
	CreatedAt        string         `json:"createdAt",omitemtpy`
	Location         LDLocation     `json:"location",omitempty`
	ObservationSpace GeoProperty    `json:"observationSpace",omitempty`
	OperationSpace   GeoProperty    `json:"operationSpace",omitempty`
	ModifiedAt       string         `json:"modifiedAt"`
}

type LDContextElementResponse

type LDContextElementResponse struct {
	LDContextElement interface{} `json:"contextElement"`
	StatusCode       StatusCode  `json:"statusCode"`
}

type LDLocation

type LDLocation struct {
	Type  string      `json:"type",omitemtpy`
	Value interface{} `json:"value",omitemtpy`
}

type LDLocationValue

type LDLocationValue struct {
	Type        string      `json:"type",omitemtpy`
	Coordinates interface{} `json:"coordinates",omitemtpy`
	Geometries  []Geometry  `json:"geometries",omitemtpy`
}

type LDNotifyContextRequest

type LDNotifyContextRequest struct {
	SubscriptionId string        `json:"subscriptionId",omitemtpy`
	Type           string        `json:"type",omitemtpy`
	Id             string        `json:"id",omitemtpy`
	Data           []interface{} `json:"data,omitempty"`
	NotifyAt       string        `json:"notifiedAt,omitempty"`
}

type LDSubscriptionRequest

type LDSubscriptionRequest struct {
	Id                string             `json:"id",omitempty`   //URI, if missing, will be assigned during subscription phase and returned to client
	Type              string             `json:"type",omitemtpy` //should be equal to "Subscription"
	Name              string             `json:"name",omitempty`
	Description       string             `json:"description",omitempty`
	Entities          []EntityId         `json:"entities",omitempty`
	WatchedAttributes []string           `json:"watchedAttributes",omitempty`
	TimeInterval      uint               `json:"timeInterval",omitempty`
	Q                 string             `json:"q",omitempty`
	GeoQ              GeoQuery           `json:"geoQ",omitempty`
	Csf               string             `json:"csf",omitempty`
	IsActive          bool               `json:"isActive",omitempty`
	Notification      NotificationParams `json:"notification"`
	Expires           string             `json:"expires",omitempty`
	Throttling        uint               `json:"throttling",omitempty`
	TemporalQ         TemporalQuery      `json:"temporalQ",omitempty`
	Status            string             `json:"status",omitempty`
	Subscriber        Subscriber         `json:"subscriber,omitempty`
	CreatedAt         string             `json:"createdAt",omitemtpy`
	ModifiedAt        string             `json:"modifiedAt",omitemtpy`
}

func (*LDSubscriptionRequest) SetLdIdPattern

func (element *LDSubscriptionRequest) SetLdIdPattern()

type MySegment

type MySegment struct {
	NW_Corner Point
	SE_Corner Point
}

type NGSI10Client

type NGSI10Client struct {
	IoTBrokerURL string
	SecurityCfg  *HTTPS
}

func (*NGSI10Client) AppendLDEntityOnRemote

func (nc *NGSI10Client) AppendLDEntityOnRemote(elem map[string]interface{}, eid string) error

func (*NGSI10Client) CreateLDEntityOnRemote

func (nc *NGSI10Client) CreateLDEntityOnRemote(elem map[string]interface{}, link string) error

func (*NGSI10Client) DeleteContext

func (nc *NGSI10Client) DeleteContext(eid *EntityId) error

func (*NGSI10Client) GetEntity

func (nc *NGSI10Client) GetEntity(id string) (*ContextObject, error)

func (*NGSI10Client) InternalDeleteContext

func (nc *NGSI10Client) InternalDeleteContext(eid *EntityId) error

func (*NGSI10Client) InternalQueryContext

func (nc *NGSI10Client) InternalQueryContext(query *QueryContextRequest) ([]ContextElement, error)

func (*NGSI10Client) InternalUpdateContext

func (nc *NGSI10Client) InternalUpdateContext(elem *ContextElement) error

func (*NGSI10Client) NotifyContext

func (nc *NGSI10Client) NotifyContext(elem *ContextElement) error

func (*NGSI10Client) QueryContext

func (nc *NGSI10Client) QueryContext(query *QueryContextRequest) ([]*ContextObject, error)

func (*NGSI10Client) QueryForNGSILDEntity

func (nc *NGSI10Client) QueryForNGSILDEntity(eid string) int

func (*NGSI10Client) QueryForNGSIV1Entity

func (nc *NGSI10Client) QueryForNGSIV1Entity(eid string) int

func (*NGSI10Client) SouthboundUpdateContext

func (nc *NGSI10Client) SouthboundUpdateContext(elem *ContextElement, fs string, fsp string) error

func (*NGSI10Client) SubscribeContext

func (nc *NGSI10Client) SubscribeContext(sub *SubscribeContextRequest, requireReliability bool) (string, error)

func (*NGSI10Client) SubscribeLdContext

func (nc *NGSI10Client) SubscribeLdContext(sub *LDSubscriptionRequest, requireReliability bool) (string, error)

func (*NGSI10Client) UnsubscribeContext

func (nc *NGSI10Client) UnsubscribeContext(sid string) error

func (*NGSI10Client) UpdateContext

func (nc *NGSI10Client) UpdateContext(elem *ContextElement) error

func (*NGSI10Client) UpdateContextObject

func (nc *NGSI10Client) UpdateContextObject(ctxObj *ContextObject) error

func (*NGSI10Client) UpdateLDEntityAttributeOnRemote

func (nc *NGSI10Client) UpdateLDEntityAttributeOnRemote(elem map[string]interface{}, eid string) (error, int)

func (*NGSI10Client) UpdateLDEntityspecificAttributeOnRemote

func (nc *NGSI10Client) UpdateLDEntityspecificAttributeOnRemote(elem map[string]interface{}, eid string, attribute string) (error, int)

type NGSI9Client

type NGSI9Client struct {
	IoTDiscoveryURL string
	SecurityCfg     *HTTPS
}

func (*NGSI9Client) DiscoverContextAvailability

func (nc *NGSI9Client) DiscoverContextAvailability(discoverCtxAvailabilityReq *DiscoverContextAvailabilityRequest) ([]ContextRegistration, error)

func (*NGSI9Client) DiscoveryNearbyIoTBroker

func (nc *NGSI9Client) DiscoveryNearbyIoTBroker(nearby NearBy) (string, error)

func (*NGSI9Client) GetProviderURL

func (nc *NGSI9Client) GetProviderURL(id string) (string, *EntityRegistration)

func (*NGSI9Client) QuerySiteList

func (nc *NGSI9Client) QuerySiteList(geoscope OperationScope) ([]SiteInfo, error)

func (*NGSI9Client) RegisterContext

func (nc *NGSI9Client) RegisterContext(registerCtxReq *RegisterContextRequest) (string, error)

func (*NGSI9Client) SendHeartBeat

func (nc *NGSI9Client) SendHeartBeat(brokerProfile *BrokerProfile) error

func (*NGSI9Client) SubscribeContextAvailability

func (nc *NGSI9Client) SubscribeContextAvailability(sub *SubscribeContextAvailabilityRequest) (string, error)

func (*NGSI9Client) UnregisterEntity

func (nc *NGSI9Client) UnregisterEntity(eid string) error

func (*NGSI9Client) UnsubscribeContextAvailability

func (nc *NGSI9Client) UnsubscribeContextAvailability(sid string) error

func (*NGSI9Client) UpdateLDContextAvailability

func (nc *NGSI9Client) UpdateLDContextAvailability(sub *SubscribeContextAvailabilityRequest, sid string) (string, error)

client to update subscribe Context availbility on discovery

type NGSIAgent

type NGSIAgent struct {
	Port                        int
	SecurityCfg                 HTTPS
	CtxNotifyHandler            NotifyContextFunc
	CtxAvailbilityNotifyHandler NotifyContextAvailabilityFunc
}

func (*NGSIAgent) SetContextAvailabilityNotifyHandler

func (agent *NGSIAgent) SetContextAvailabilityNotifyHandler(cb NotifyContextAvailabilityFunc)

func (*NGSIAgent) SetContextNotifyHandler

func (agent *NGSIAgent) SetContextNotifyHandler(cb NotifyContextFunc)

func (*NGSIAgent) Start

func (agent *NGSIAgent) Start()

type NGSIV2Client

type NGSIV2Client struct {
	IoTDiscoveryURL string
	SecurityCfg     *HTTPS
}

func (*NGSIV2Client) Subscribev2ContextAvailability

func (nc *NGSIV2Client) Subscribev2ContextAvailability(sub *SubscribeContextAvailabilityRequest) (string, error)

func (*NGSIV2Client) Unsubscribev2ContextAvailability

func (nc *NGSIV2Client) Unsubscribev2ContextAvailability(sid string) error

type NearBy

type NearBy struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Limit     int     `json:"limit"`
}

type Notification

type Notification struct {
	Http Http `json:"http"`

	Attrs       []string `json:"attrs,omitempty"`
	Metadata    string   `json:"metadata,omitempty"`
	ExcetAttrs  []string `json:"exceptAttrs,omitempty"`
	AttrsFormat string   `json:"attrsFormat,omitempty"`
}

type NotificationParams

type NotificationParams struct {
	Attributes       []string `json:"attributes",omitempty`
	Format           string   `json:"format",omitempty`
	Endpoint         Endpoint `json:"endpoint",omitemtpy`
	Status           string   `json:"status",omitempty`
	TimeSent         uint     `json:"timeSent",omitempty`
	LastNotification string   `json:"lastNotification",omitempty`
	LastFailure      string   `json:"lastFailure",omitempty`
	LastSuccess      string   `json:"lastSuccess",omitempty`
}

type NotifyCondition

type NotifyCondition struct {
	Type        string   `json:"type"`
	CondValues  []string `json:"condValueList,omitempty"`
	Restriction string   `json:"restriction,omitempty"`
}

type NotifyConditionType

type NotifyConditionType int
const (
	ONTIMEINTERVAL NotifyConditionType = 1
	ONVALUE
	ONCHANGE
)

type NotifyContextAvailabilityFunc

type NotifyContextAvailabilityFunc func(notifyCtxAvailReq *NotifyContextAvailabilityRequest)

type NotifyContextAvailabilityRequest

type NotifyContextAvailabilityRequest struct {
	SubscriptionId                  string                        `json:"subscribeId"`
	ContextRegistrationResponseList []ContextRegistrationResponse `json:"contextRegistrationResponses,omitempty"`
	ErrorCode                       StatusCode                    `json:"errorCode,omitempty"`
}

type NotifyContextAvailabilityResponse

type NotifyContextAvailabilityResponse struct {
	ResponseCode StatusCode `json:"responseCode"`
}

type NotifyContextFunc

type NotifyContextFunc func(notifyCtxReq *NotifyContextRequest)

type NotifyContextRequest

type NotifyContextRequest struct {
	SubscriptionId   string                   `json:"subscriptionId"`
	Originator       string                   `json:"originator"`
	ContextResponses []ContextElementResponse `json:"contextResponses,omitempty"`
}

type NotifyContextResponse

type NotifyContextResponse struct {
	ResponseCode StatusCode `json:"responseCode"`
}

type Notifyv2ContextAvailabilityRequest

type Notifyv2ContextAvailabilityRequest struct {
	SubscriptionId                  string                        `json:"subscribeId"`
	ContextRegistrationResponseList []ContextRegistrationResponse `json:"contextRegistrationResponses,omitempty"`
	ErrorCode                       StatusCode                    `json:"errorCode,omitempty"`
}

type Notifyv2ContextAvailabilityResponse

type Notifyv2ContextAvailabilityResponse struct {
	ResponseCode StatusCode `json:"responseCode"`
}

type OperationScope

type OperationScope struct {
	Type  string      `json:"scopeType"`
	Value interface{} `json:"scopeValue"`
}

func (*OperationScope) UnmarshalJSON

func (scope *OperationScope) UnmarshalJSON(b []byte) error

type OrionContextAttribute

type OrionContextAttribute struct {
	Name     string            `json:"name"`
	Type     string            `json:"type,omitempty"`
	Value    interface{}       `json:"value"`
	Metadata []ContextMetadata `json:"metadata,omitempty"`
}

type Point

type Point struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

func (*Point) IsEmpty

func (p *Point) IsEmpty() bool

type Polygon

type Polygon struct {
	Vertices []Point `json:"vertices"`
}

type ProblemDetails

type ProblemDetails struct {
	Type    string `json: "type",omitemtpy`
	Status  string `json: "status",omitemtpy`
	Title   string `json: "title",omitemtpy`
	Details string `json: "details",omitemtpy`
}

type Property

type Property struct {
	Name          string      `json:"name",omitemtpy`
	Type          string      `json:"type",omitemtpy`
	Value         interface{} `json:"value",omitemtpy` // Can also be a string or a JSON object
	ObservedAt    string      `json:"observedAt",omitempty`
	DatasetId     string      `json:"DatasetId",omitempty`  //<<URI>>, Optional.
	InstanceId    string      `json:"InstanceId",omitempty` //<<URI>> uniquely identifying a relationship instance. System Generated, Optional.
	CreatedAt     string      `json:"createdAt",omitemtpy`
	ModifiedAt    string      `json:"modifiedAt",omitemtpy`
	UnitCode      string      `json:"UnitCode",omitempty`
	ProvidedBy    ProvidedBy  `json:"providedBy",omitempty`
	Properties    []Property
	Relationships []Relationship
}

type ProvidedBy

type ProvidedBy struct {
	Type   string `json:"type",omitemtpy`
	Object string `json:"object",omitemtpy`
}

type QueryContextRequest

type QueryContextRequest struct {
	Entities    []EntityId  `json:"entities"`
	Attributes  []string    `json:"attributes,omitempty"`
	Restriction Restriction `json:"restriction,omitempty"`
}

NGSI10

type QueryContextResponse

type QueryContextResponse struct {
	ContextResponses []ContextElementResponse `json:"contextResponses,omitempty"`
	ErrorCode        StatusCode               `json:"errorCode,omitempty"`
}

type RegisterContextRequest

type RegisterContextRequest struct {
	ContextRegistrations []ContextRegistration `json:"contextRegistrations,omitempty"`
	Duration             string                `json:"duration,omitempty"`
	RegistrationId       string                `json:"registrationId,omitempty"`
}

NGSI9

type RegisterContextRequest1

type RegisterContextRequest1 struct {
	ContextRegistrations []ContextRegistration1 `json:"contextRegistrations,omitempty"`
	Duration             string                 `json:"duration,omitempty"`
	RegistrationId       string                 `json:"registrationId,omitempty"`
}

To handle RegisterContextRequest coming from IoT Agent

type RegisterContextResponse

type RegisterContextResponse struct {
	Duration       string     `json:"duration,omitempty"`
	RegistrationId string     `json:"registrationId"`
	ErrorCode      StatusCode `json:"errorCode,omitempty"`
}

type RegistrationInfo

type RegistrationInfo struct {
	Entities      []EntityId `json:"entities",omitempty`
	Properties    []string   `json:"properties,omitempty"`
	Relationships []string   `json:"relationships,omitempty"`
}

type Relationship

type Relationship struct {
	Name          string     `json:"name",omitemtpy`
	Type          string     `json:"type",omitemtpy`
	Object        string     `json:object,omitemtpy` //<<URI>>, Mandatory
	ObservedAt    string     `json:"observedAt",omitempty`
	ProvidedBy    ProvidedBy `json:"providedBy",omitempty`
	DatasetId     string     `json:"DatasetId",omitempty`  //<<URI>>, Optional.
	InstanceId    string     `json:"InstanceId",omitempty` //<<URI>> uniquely identifying a relationship instance. System Generated, Optional.
	CreatedAt     string     `json:"createdAt",omitemtpy`
	ModifiedAt    string     `json:"modifiedAt",omitemtpy`
	Properties    []Property
	Relationships []Relationship
}

type ResponseError

type ResponseError struct {
	Success []string         `json: "success",omitemtpy`
	Errors  []ProblemDetails `json: "errors",omitemtpy`
}

type Restriction

type Restriction struct {
	AttributeExpression string           `json:"attributeExpression, omitempty"`
	Scopes              []OperationScope `json:"scopes,omitempty"`
}

func (*Restriction) GetNearbyFilter

func (restriction *Restriction) GetNearbyFilter() *NearBy

func (*Restriction) GetScope

func (restriction *Restriction) GetScope() OperationScope

type Segment

type Segment struct {
	NW_Corner string `json:"nw_Corner"`
	SE_Corner string `json:"se_Corner"`
}

func (*Segment) Converter

func (sg *Segment) Converter() MySegment

type SiteInfo

type SiteInfo struct {
	ExternalAddress string `json:"externalAddress"`
	GeohashID       string `json:"geohashID"`
	IsLocalSite     bool   `json:"isLocalSite"`
}

type StatusCode

type StatusCode struct {
	Code         int    `json:"code"`
	ReasonPhrase string `json:"reasonPhrase,omitempty"`
	Details      string `json:"details,omitempty"`
}

type Subject

type Subject struct {
	Entities   []EntityId `json:"entities"`
	Conditions Conditions `json:"condition,omitempty"`
}

func (*Subject) SetIDpattern

func (element *Subject) SetIDpattern()

Integration with wirecloud

type SubscribeContextAvailabilityRequest

type SubscribeContextAvailabilityRequest struct {
	Entities       []EntityId  `json:"entities"`
	Attributes     []string    `json:"attributes,omitempty"`
	Reference      string      `json:"reference"`
	Duration       string      `json:"duration,omitempty"`
	Restriction    Restriction `json:"restriction,omitempty"`
	SubscriptionId string      `json:"subscriptionId,omitempty"`
}

type SubscribeContextAvailabilityResponse

type SubscribeContextAvailabilityResponse struct {
	SubscriptionId string     `json:"subscribeId"`
	Duration       string     `json:"duration,omitempty"`
	ErrorCode      StatusCode `json:"errorCode,omitempty"`
}

type SubscribeContextRequest

type SubscribeContextRequest struct {
	Entities         []EntityId        `json:"entities"`
	Attributes       []string          `json:"attributes,omitempty"`
	Reference        string            `json:"reference"`
	Duration         string            `json:"duration,omitempty"`
	Restriction      Restriction       `json:"restriction,omitempty"`
	NotifyConditions []NotifyCondition `json:"notifyConditions,omitempty"`
	Throttling       string            `json:"throttling,omitempty"`
	Subscriber       Subscriber
}

type SubscribeContextResponse

type SubscribeContextResponse struct {
	SubscribeResponse SubscribeResponse `json:"subscribeResponse,omitempty"`
	SubscribeError    SubscribeError    `json:"subscribeError,omitempty"`
}

type SubscribeError

type SubscribeError struct {
	SubscriptionId string     `json:"subscriptionId,omitempty"`
	ErrorCode      StatusCode `json:"errorCode"`
}

type SubscribeResponse

type SubscribeResponse struct {
	SubscriptionId string `json:"subscriptionId"`
	Duration       string `json:"duration,omitempty"`
	Throttling     string `json:"throttling,omitempty"`
}

type Subscriber

type Subscriber struct {
	IsOrion            bool
	IsInternal         bool
	RequireReliability bool
	BrokerURL          string
	Integration        bool
	NotifyCache        []*ContextElement
	LDNotifyCache      []map[string]interface{}
}

type Subscribev2ContextAvailabilityRequest

type Subscribev2ContextAvailabilityRequest struct {
	Entities       []EntityId   `json:"entities"`
	Attributes     []string     `json:"attributes,omitempty"`
	Reference      string       `json:"reference"`
	Duration       string       `json:"duration,omitempty"`
	Restriction    Restriction  `json:"restriction,omitempty"`
	Subject        Subject      `json:"subject"`
	SubscriptionId string       `json:"subscriptionId,omitempty"`
	Notification   Notification `json:"notification"`
	Conditions     Conditions   `json:"condition,omitempty"`
	Throttling     int          `json:"throttling,omitempty"`
	Expires        string       `json:"expires,omitempty"`
	Status         string       `json:"status,omitempty"`
}

type Subscribev2ContextAvailabilityResponse

type Subscribev2ContextAvailabilityResponse struct {
	SubscriptionId string `json:"subscribeId"`
	//        Duration       string     `json:"duration,omitempty"`
	ErrorCode StatusCode `json:"errorCode,omitempty"`
}

type Subscribev2Response

type Subscribev2Response struct {
	SubscriptionResponse SubscriptionResponse `json:"subscribeResponse,omitempty"`
	SubscriptionError    SubscriptionError    `json:"subscribeError,omitempty"`
}

type SubscriptionError

type SubscriptionError struct {
	SubscriptionId string     `json:"subscriptionId,omitempty"`
	ErrorCode      StatusCode `json:"errorCode"`
}

type SubscriptionRequest

type SubscriptionRequest struct {
	Attributes   []string `json:"attributes,omitempty"`
	Subscriber   Subscriber
	Conditions   Conditions   `json:"condition,omitempty"`
	Description  string       `json:"description,omitempty"`
	Subject      Subject      `json:"subject"`
	Notification Notification `json:"notification"`
	Throttling   int          `json:"throttling,omitempty"`
	Expires      string       `json:"expires,omitempty"`
	Status       string       `json:"status,omitempty"`
}

type SubscriptionResponse

type SubscriptionResponse struct {
	SubscriptionId string `json:"subscriptionId"`
	Duration       string `json:"duration,omitempty"`
	Throttling     string `json:"throttling,omitempty"`
}

type TemporalQuery

type TemporalQuery struct {
	TimeRel      string `json:"timerel",omitemtpy`
	Time         string `json:"time",omitemtpy`
	EndTime      string `json:"endTime",omitempty`
	TimeProperty string `json:"timeproperty",omitempty`
}

type TimeInterval

type TimeInterval struct {
	Start string `json:"start",omitemtpy` //DateTime value
	End   string `json:"end",omitempty`   //DateTime value
}

type UnsubscribeContextAvailabilityRequest

type UnsubscribeContextAvailabilityRequest struct {
	SubscriptionId string `json:"subscriptionId"`
}

type UnsubscribeContextAvailabilityResponse

type UnsubscribeContextAvailabilityResponse struct {
	SubscriptionId string     `json:"subscriptionId"`
	StatusCode     StatusCode `json:"statusCode"`
}

type UnsubscribeContextRequest

type UnsubscribeContextRequest struct {
	SubscriptionId string `json:"subscriptionId"`
}

type UnsubscribeContextResponse

type UnsubscribeContextResponse struct {
	SubscriptionId string     `json:"subscriptionId"`
	StatusCode     StatusCode `json:"statusCode"`
}

type Unsubscribev2ContextAvailabilityRequest

type Unsubscribev2ContextAvailabilityRequest struct {
	SubscriptionId string `json:"subscriptionId"`
}

type Unsubscribev2ContextAvailabilityResponse

type Unsubscribev2ContextAvailabilityResponse struct {
	SubscriptionId string     `json:"subscriptionId"`
	StatusCode     StatusCode `json:"statusCode"`
}

type UpdateActionType

type UpdateActionType int
const (
	UPDATE UpdateActionType = 1
	APPEND
	DELETE
)

type UpdateContextAvailabilitySubscriptionRequest

type UpdateContextAvailabilitySubscriptionRequest struct {
	Entities       []EntityId         `json:"entities"`
	Attributes     []ContextAttribute `json:"attributes,omitempty"`
	Duration       string             `json:"duration,omitempty"`
	Restriction    Restriction        `json:"restriction,omitempty"`
	SubscriptionId string             `json:"subscriptionId,omitempty"`
}

type UpdateContextAvailabilitySubscriptionResponse

type UpdateContextAvailabilitySubscriptionResponse struct {
	SubscriptionId string     `json:"subscriptionId"`
	Duration       string     `json:"duration,omitempty"`
	ErrorCode      StatusCode `json:"errorCode,omitempty"`
}

type UpdateContextRequest

type UpdateContextRequest struct {
	ContextElements []ContextElement `json:"contextElements"`
	UpdateAction    string           `json:"updateAction"`
}

type UpdateContextResponse

type UpdateContextResponse struct {
	ContextResponses []ContextElementResponse `json:"contextResponses"`
}

type UpdateContextSubscriptionRequest

type UpdateContextSubscriptionRequest struct {
	SubscriptionId   string            `json:"subscriptionId"`
	Duration         string            `json:"duration,omitempty"`
	Restriction      Restriction       `json:"restriction,omitempty"`
	NotifyConditions []NotifyCondition `json:"notifyConditions,omitempty"`
	Throttling       string            `json:"throttling,omitempty"`
}

type UpdateContextSubscriptionResponse

type UpdateContextSubscriptionResponse struct {
	SubscribeResponse `json:"subscribeResponse,omitempty"`
	SubscribeError    `json:"subscribeError,omitempty"`
}

type ValueObject

type ValueObject struct {
	Type  string      `json:"type,omitempty"`
	Value interface{} `json:"value"`
}

Jump to

Keyboard shortcuts

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