mongo

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mongo provides an implementation of DBClient which uses MongoDB as the underlying data-store.

Deprecated: Mongo functionality is deprecated as of the Geneva release and no new functionality should be added; Only bugs which address legacy issues

******************************************************************************

  • Copyright 2017 Dell Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2018 Dell Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

Index

Constants

View Source
const (
	NOTIFICATION_COLLECTION = "notification"
	SUBSCRIPTION_COLLECTION = "subscription"
	TRANSMISSION_COLLECTION = "transmission"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient deprecated

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

MongoClient implements DBClient and provides functionality for interacting with MongoDB.

Deprecated: Mongo functionality is deprecated as of the Geneva release and no new functionality should be added; Only bugs which address legacy issues

func NewClient deprecated

func NewClient(config db.Configuration) (MongoClient, error)

Return a pointer to the MongoClient

Deprecated: MongoClient is deprecated as of the Geneva release.

func (MongoClient) AddAddressable

func (mc MongoClient) AddAddressable(a contract.Addressable) (string, error)

func (MongoClient) AddDevice

func (mc MongoClient) AddDevice(d contract.Device, commands []contract.Command) (string, error)

----------------------------- Device ----------------------------------

func (MongoClient) AddDeviceProfile

func (mc MongoClient) AddDeviceProfile(dp contract.DeviceProfile) (string, error)

func (MongoClient) AddDeviceReport

func (mc MongoClient) AddDeviceReport(d contract.DeviceReport) (string, error)

func (MongoClient) AddDeviceService

func (mc MongoClient) AddDeviceService(ds contract.DeviceService) (string, error)

func (MongoClient) AddEvent

func (mc MongoClient) AddEvent(e correlation.Event) (string, error)

Add a new event UnexpectedError - failed to add to database NoValueDescriptor - no existing value descriptor for a reading in the event

func (MongoClient) AddInterval

func (mc MongoClient) AddInterval(interval contract.Interval) (string, error)

Add an Interval UnexpectedError - failed to add interval into the database

func (MongoClient) AddIntervalAction

func (mc MongoClient) AddIntervalAction(action contract.IntervalAction) (string, error)

Add a new Interval Action UnexpectedError - failed to add interval action into the database

func (MongoClient) AddNotification

func (mc MongoClient) AddNotification(n contract.Notification) (string, error)

func (MongoClient) AddProvisionWatcher

func (mc MongoClient) AddProvisionWatcher(pw contract.ProvisionWatcher) (string, error)

func (MongoClient) AddReading

func (mc MongoClient) AddReading(r contract.Reading) (string, error)

Post a new reading

func (MongoClient) AddSubscription

func (mc MongoClient) AddSubscription(sub contract.Subscription) (string, error)

func (MongoClient) AddTransmission

func (mc MongoClient) AddTransmission(t contract.Transmission) (string, error)

func (MongoClient) AddValueDescriptor

func (mc MongoClient) AddValueDescriptor(v contract.ValueDescriptor) (string, error)

Add a value descriptor 409 - Formatting is bad or it is not unique 503 - Unexpected TODO: Check for valid printf formatting

func (MongoClient) AddressableToDBRef

func (mc MongoClient) AddressableToDBRef(a models.Addressable) (dbRef mgo.DBRef, err error)

func (MongoClient) Cleanup

func (mc MongoClient) Cleanup() error

func (MongoClient) CleanupOld

func (mc MongoClient) CleanupOld(age int) error

func (MongoClient) CloseSession

func (mc MongoClient) CloseSession()

func (MongoClient) DBRefToAddressable

func (mc MongoClient) DBRefToAddressable(dbRef mgo.DBRef) (a models.Addressable, err error)

func (MongoClient) DBRefToDeviceProfile

func (mc MongoClient) DBRefToDeviceProfile(dbRef mgo.DBRef) (a models.DeviceProfile, err error)

func (MongoClient) DBRefToDeviceService

func (mc MongoClient) DBRefToDeviceService(dbRef mgo.DBRef) (ds models.DeviceService, err error)

func (MongoClient) DBRefToReading

func (mc MongoClient) DBRefToReading(dbRef mgo.DBRef) (a models.Reading, err error)

func (MongoClient) DeleteAddressableById

func (mc MongoClient) DeleteAddressableById(id string) error

func (MongoClient) DeleteDeviceById

func (mc MongoClient) DeleteDeviceById(id string) error

func (MongoClient) DeleteDeviceProfileById

func (mc MongoClient) DeleteDeviceProfileById(id string) error

func (MongoClient) DeleteDeviceReportById

func (mc MongoClient) DeleteDeviceReportById(id string) error

func (MongoClient) DeleteDeviceServiceById

func (mc MongoClient) DeleteDeviceServiceById(id string) error

func (MongoClient) DeleteEventById

func (mc MongoClient) DeleteEventById(id string) error

Delete an event by ID and all of its readings 404 - Event not found 503 - Unexpected problems

func (MongoClient) DeleteEventsByDevice

func (mc MongoClient) DeleteEventsByDevice(deviceId string) (int, error)

DeleteEventsByDevice Delete events and readings associated with the specified device ID

func (MongoClient) DeleteIntervalActionById

func (mc MongoClient) DeleteIntervalActionById(id string) error

Remove an Interval Action by ID UnexpectedError - failed to remove interval action from the database

func (MongoClient) DeleteIntervalById

func (mc MongoClient) DeleteIntervalById(id string) error

Remove an Interval by ID UnexpectedError - failed to remove interval from the database

func (MongoClient) DeleteNotificationById

func (mc MongoClient) DeleteNotificationById(id string) error

func (MongoClient) DeleteNotificationBySlug

func (mc MongoClient) DeleteNotificationBySlug(slug string) error

func (MongoClient) DeleteNotificationsOld

func (mc MongoClient) DeleteNotificationsOld(age int) error

func (MongoClient) DeleteProvisionWatcherById

func (mc MongoClient) DeleteProvisionWatcherById(id string) error

func (MongoClient) DeleteReadingById

func (mc MongoClient) DeleteReadingById(id string) error

Delete a reading by ID 404 - can't find the reading with the given id

func (MongoClient) DeleteReadingsByDevice

func (mc MongoClient) DeleteReadingsByDevice(deviceId string) error

func (MongoClient) DeleteSubscriptionById

func (mc MongoClient) DeleteSubscriptionById(id string) error

func (MongoClient) DeleteSubscriptionBySlug

func (mc MongoClient) DeleteSubscriptionBySlug(slug string) error

func (MongoClient) DeleteTransmission

func (mc MongoClient) DeleteTransmission(age int64, status contract.TransmissionStatus) error

func (MongoClient) DeleteValueDescriptorById

func (mc MongoClient) DeleteValueDescriptorById(id string) error

Delete the value descriptor based on the id Not found error if there isn't a value descriptor for the ID ValueDescriptorStillInUse if the value descriptor is still referenced by readings

func (MongoClient) DeviceProfileToDBRef

func (mc MongoClient) DeviceProfileToDBRef(model models.DeviceProfile) (dbRef mgo.DBRef, err error)

func (MongoClient) DeviceServiceToDBRef

func (mc MongoClient) DeviceServiceToDBRef(model models.DeviceService) (dbRef mgo.DBRef, err error)

func (MongoClient) EventById

func (mc MongoClient) EventById(id string) (contract.Event, error)

Get an event by id

func (MongoClient) EventCount

func (mc MongoClient) EventCount() (int, error)

Get the number of events in Mongo

func (MongoClient) EventCountByDeviceId

func (mc MongoClient) EventCountByDeviceId(id string) (int, error)

Get the number of events in Mongo for the device

func (MongoClient) Events

func (mc MongoClient) Events() ([]contract.Event, error)

Return all the events UnexpectedError - failed to retrieve events from the database Sort the events in descending order by ID

func (MongoClient) EventsByChecksum

func (mc MongoClient) EventsByChecksum(checksum string) ([]contract.Event, error)

EventsByChecksum get events with matching checksum

func (MongoClient) EventsByCreationTime

func (mc MongoClient) EventsByCreationTime(startTime, endTime int64, limit int) ([]contract.Event, error)

Return a list of events whose creation time is between startTime and endTime Limit the number of results by limit

func (MongoClient) EventsForDevice

func (mc MongoClient) EventsForDevice(id string) ([]contract.Event, error)

Get a list of events based on the device id

func (MongoClient) EventsForDeviceLimit

func (mc MongoClient) EventsForDeviceLimit(id string, limit int) ([]contract.Event, error)

Get a list of events based on the device id and limit

func (MongoClient) EventsOlderThanAge

func (mc MongoClient) EventsOlderThanAge(age int64) ([]contract.Event, error)

Get Events that are older than the given age (defined by age = now - created)

func (MongoClient) EventsPushed

func (mc MongoClient) EventsPushed() ([]contract.Event, error)

Get all of the events that have been pushed

func (MongoClient) EventsWithLimit

func (mc MongoClient) EventsWithLimit(limit int) ([]contract.Event, error)

Return events up to the max number specified UnexpectedError - failed to retrieve events from the database Sort the events in descending order by ID

func (MongoClient) GetAddressableById

func (mc MongoClient) GetAddressableById(id string) (contract.Addressable, error)

func (MongoClient) GetAddressableByName

func (mc MongoClient) GetAddressableByName(n string) (contract.Addressable, error)

func (MongoClient) GetAddressables

func (mc MongoClient) GetAddressables() ([]contract.Addressable, error)

func (MongoClient) GetAddressablesByAddress

func (mc MongoClient) GetAddressablesByAddress(add string) ([]contract.Addressable, error)

func (MongoClient) GetAddressablesByPort

func (mc MongoClient) GetAddressablesByPort(p int) ([]contract.Addressable, error)

func (MongoClient) GetAddressablesByPublisher

func (mc MongoClient) GetAddressablesByPublisher(p string) ([]contract.Addressable, error)

func (MongoClient) GetAddressablesByTopic

func (mc MongoClient) GetAddressablesByTopic(t string) ([]contract.Addressable, error)

func (MongoClient) GetAllCommands

func (mc MongoClient) GetAllCommands() ([]contract.Command, error)

func (MongoClient) GetAllDeviceProfiles

func (mc MongoClient) GetAllDeviceProfiles() ([]contract.DeviceProfile, error)

func (MongoClient) GetAllDeviceReports

func (mc MongoClient) GetAllDeviceReports() ([]contract.DeviceReport, error)

func (MongoClient) GetAllDeviceServices

func (mc MongoClient) GetAllDeviceServices() ([]contract.DeviceService, error)

func (MongoClient) GetAllDevices

func (mc MongoClient) GetAllDevices() ([]contract.Device, error)

func (MongoClient) GetAllProvisionWatchers

func (mc MongoClient) GetAllProvisionWatchers() (pw []contract.ProvisionWatcher, err error)

----------------------Provision Watcher -----------------------------*/

func (MongoClient) GetCommandById

func (mc MongoClient) GetCommandById(id string) (contract.Command, error)

func (MongoClient) GetCommandByNameAndDeviceId

func (mc MongoClient) GetCommandByNameAndDeviceId(cname string, did string) (contract.Command, error)

func (MongoClient) GetCommandsByDeviceId

func (mc MongoClient) GetCommandsByDeviceId(did string) ([]contract.Command, error)

func (MongoClient) GetCommandsByName

func (mc MongoClient) GetCommandsByName(n string) ([]contract.Command, error)

func (MongoClient) GetDeviceById

func (mc MongoClient) GetDeviceById(id string) (contract.Device, error)

func (MongoClient) GetDeviceByName

func (mc MongoClient) GetDeviceByName(n string) (contract.Device, error)

func (MongoClient) GetDeviceProfileById

func (mc MongoClient) GetDeviceProfileById(id string) (contract.DeviceProfile, error)

func (MongoClient) GetDeviceProfileByName

func (mc MongoClient) GetDeviceProfileByName(n string) (contract.DeviceProfile, error)

func (MongoClient) GetDeviceProfilesByManufacturer

func (mc MongoClient) GetDeviceProfilesByManufacturer(man string) ([]contract.DeviceProfile, error)

func (MongoClient) GetDeviceProfilesByManufacturerModel

func (mc MongoClient) GetDeviceProfilesByManufacturerModel(man string, mod string) ([]contract.DeviceProfile, error)

func (MongoClient) GetDeviceProfilesByModel

func (mc MongoClient) GetDeviceProfilesByModel(model string) ([]contract.DeviceProfile, error)

func (MongoClient) GetDeviceProfilesWithLabel

func (mc MongoClient) GetDeviceProfilesWithLabel(l string) ([]contract.DeviceProfile, error)

func (MongoClient) GetDeviceReportByDeviceName

func (mc MongoClient) GetDeviceReportByDeviceName(n string) ([]contract.DeviceReport, error)

func (MongoClient) GetDeviceReportById

func (mc MongoClient) GetDeviceReportById(id string) (contract.DeviceReport, error)

func (MongoClient) GetDeviceReportByName

func (mc MongoClient) GetDeviceReportByName(n string) (contract.DeviceReport, error)

func (MongoClient) GetDeviceReportsByAction

func (mc MongoClient) GetDeviceReportsByAction(n string) ([]contract.DeviceReport, error)

func (MongoClient) GetDeviceServiceById

func (mc MongoClient) GetDeviceServiceById(id string) (contract.DeviceService, error)

func (MongoClient) GetDeviceServiceByName

func (mc MongoClient) GetDeviceServiceByName(n string) (contract.DeviceService, error)

func (MongoClient) GetDeviceServicesByAddressableId

func (mc MongoClient) GetDeviceServicesByAddressableId(id string) ([]contract.DeviceService, error)

func (MongoClient) GetDeviceServicesWithLabel

func (mc MongoClient) GetDeviceServicesWithLabel(l string) ([]contract.DeviceService, error)

func (MongoClient) GetDevicesByProfileId

func (mc MongoClient) GetDevicesByProfileId(id string) ([]contract.Device, error)

func (MongoClient) GetDevicesByServiceId

func (mc MongoClient) GetDevicesByServiceId(id string) ([]contract.Device, error)

func (MongoClient) GetDevicesWithLabel

func (mc MongoClient) GetDevicesWithLabel(l string) ([]contract.Device, error)

func (MongoClient) GetNewNormalNotifications

func (mc MongoClient) GetNewNormalNotifications(limit int) ([]contract.Notification, error)

func (MongoClient) GetNewNotifications

func (mc MongoClient) GetNewNotifications(limit int) ([]contract.Notification, error)

func (MongoClient) GetNotificationById

func (mc MongoClient) GetNotificationById(id string) (contract.Notification, error)

func (MongoClient) GetNotificationBySender

func (mc MongoClient) GetNotificationBySender(sender string, limit int) ([]contract.Notification, error)

func (MongoClient) GetNotificationBySlug

func (mc MongoClient) GetNotificationBySlug(slug string) (contract.Notification, error)

func (MongoClient) GetNotifications

func (mc MongoClient) GetNotifications() ([]contract.Notification, error)

func (MongoClient) GetNotificationsByEnd

func (mc MongoClient) GetNotificationsByEnd(end int64, limit int) ([]contract.Notification, error)

func (MongoClient) GetNotificationsByLabels

func (mc MongoClient) GetNotificationsByLabels(labels []string, limit int) ([]contract.Notification, error)

func (MongoClient) GetNotificationsByStart

func (mc MongoClient) GetNotificationsByStart(start int64, limit int) ([]contract.Notification, error)

func (MongoClient) GetNotificationsByStartEnd

func (mc MongoClient) GetNotificationsByStartEnd(start int64, end int64, limit int) ([]contract.Notification, error)

func (MongoClient) GetProvisionWatcher

func (mc MongoClient) GetProvisionWatcher(q bson.M) (pw contract.ProvisionWatcher, err error)

func (MongoClient) GetProvisionWatcherById

func (mc MongoClient) GetProvisionWatcherById(id string) (pw contract.ProvisionWatcher, err error)

func (MongoClient) GetProvisionWatcherByName

func (mc MongoClient) GetProvisionWatcherByName(n string) (pw contract.ProvisionWatcher, err error)

func (MongoClient) GetProvisionWatchersByIdentifier

func (mc MongoClient) GetProvisionWatchersByIdentifier(k string, v string) (pw []contract.ProvisionWatcher, err error)

func (MongoClient) GetProvisionWatchersByProfileId

func (mc MongoClient) GetProvisionWatchersByProfileId(id string) (pw []contract.ProvisionWatcher, err error)

func (MongoClient) GetProvisionWatchersByServiceId

func (mc MongoClient) GetProvisionWatchersByServiceId(id string) (pw []contract.ProvisionWatcher, err error)

func (MongoClient) GetSubscriptionByCategories

func (mc MongoClient) GetSubscriptionByCategories(categories []string) ([]contract.Subscription, error)

func (MongoClient) GetSubscriptionByCategoriesLabels

func (mc MongoClient) GetSubscriptionByCategoriesLabels(categories []string, labels []string) ([]contract.Subscription, error)

func (MongoClient) GetSubscriptionById

func (mc MongoClient) GetSubscriptionById(id string) (contract.Subscription, error)

func (MongoClient) GetSubscriptionByLabels

func (mc MongoClient) GetSubscriptionByLabels(labels []string) ([]contract.Subscription, error)

func (MongoClient) GetSubscriptionByReceiver

func (mc MongoClient) GetSubscriptionByReceiver(receiver string) ([]contract.Subscription, error)

func (MongoClient) GetSubscriptionBySlug

func (mc MongoClient) GetSubscriptionBySlug(slug string) (contract.Subscription, error)

func (MongoClient) GetSubscriptions

func (mc MongoClient) GetSubscriptions() ([]contract.Subscription, error)

Return all the subscriptions UnexpectedError - failed to retrieve subscriptions from the database

func (MongoClient) GetTransmissionById

func (mc MongoClient) GetTransmissionById(id string) (contract.Transmission, error)

func (MongoClient) GetTransmissionsByEnd

func (mc MongoClient) GetTransmissionsByEnd(end int64, limit int) ([]contract.Transmission, error)

func (MongoClient) GetTransmissionsByNotificationSlug

func (mc MongoClient) GetTransmissionsByNotificationSlug(slug string, limit int) ([]contract.Transmission, error)

func (MongoClient) GetTransmissionsByNotificationSlugAndStartEnd

func (mc MongoClient) GetTransmissionsByNotificationSlugAndStartEnd(slug string, start int64, end int64, limit int) ([]contract.Transmission, error)

func (MongoClient) GetTransmissionsByStart

func (mc MongoClient) GetTransmissionsByStart(start int64, limit int) ([]contract.Transmission, error)

func (MongoClient) GetTransmissionsByStartEnd

func (mc MongoClient) GetTransmissionsByStartEnd(start int64, end int64, limit int) ([]contract.Transmission, error)

func (MongoClient) GetTransmissionsByStatus

func (mc MongoClient) GetTransmissionsByStatus(limit int, status contract.TransmissionStatus) ([]contract.Transmission, error)

func (MongoClient) IntervalActionById

func (mc MongoClient) IntervalActionById(id string) (contract.IntervalAction, error)

Return an Interval Action by ID UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalActionByName

func (mc MongoClient) IntervalActionByName(name string) (contract.IntervalAction, error)

Return an Interval Action by name UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalActions

func (mc MongoClient) IntervalActions() ([]contract.IntervalAction, error)

Return all the Interval Action(s) UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalActionsByIntervalName

func (mc MongoClient) IntervalActionsByIntervalName(name string) ([]contract.IntervalAction, error)

Return Interval Action(s) by interval name UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalActionsByTarget

func (mc MongoClient) IntervalActionsByTarget(name string) ([]contract.IntervalAction, error)

Return Interval Action(s) by target name UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalActionsWithLimit

func (mc MongoClient) IntervalActionsWithLimit(limit int) ([]contract.IntervalAction, error)

Return Interval Action(s) up to the max number specified UnexpectedError - failed to retrieve interval actions from the database Sort the interval actions in descending order by ID

func (MongoClient) IntervalById

func (mc MongoClient) IntervalById(id string) (contract.Interval, error)

Return an Interval by ID UnexpectedError - failed to retrieve interval from the database

func (MongoClient) IntervalByName

func (mc MongoClient) IntervalByName(name string) (contract.Interval, error)

Return an Interval by name UnexpectedError - failed to retrieve interval from the database

func (MongoClient) Intervals

func (mc MongoClient) Intervals() ([]contract.Interval, error)

func (MongoClient) IntervalsWithLimit

func (mc MongoClient) IntervalsWithLimit(limit int) ([]contract.Interval, error)

Return Interval(s) up to the max number specified UnexpectedError - failed to retrieve intervals from the database Sort the intervals in descending order by ID

func (MongoClient) MarkNotificationProcessed

func (mc MongoClient) MarkNotificationProcessed(n contract.Notification) error

func (MongoClient) ReadingById

func (mc MongoClient) ReadingById(id string) (contract.Reading, error)

Get a reading by ID

func (MongoClient) ReadingCount

func (mc MongoClient) ReadingCount() (int, error)

Get the count of readings in Mongo

func (MongoClient) ReadingToDBRef

func (mc MongoClient) ReadingToDBRef(r models.Reading) (dbRef mgo.DBRef, err error)

func (MongoClient) Readings

func (mc MongoClient) Readings() ([]contract.Reading, error)

Return a list of readings sorted by reading id

func (MongoClient) ReadingsByCreationTime

func (mc MongoClient) ReadingsByCreationTime(start, end int64, limit int) ([]contract.Reading, error)

Return a list of readings whose creation time is in-between start and end Limit by the limit parameter

func (MongoClient) ReadingsByDevice

func (mc MongoClient) ReadingsByDevice(id string, limit int) ([]contract.Reading, error)

Return a list of readings for the given device (id or name) Sort the list of readings on creation date

func (MongoClient) ReadingsByDeviceAndValueDescriptor

func (mc MongoClient) ReadingsByDeviceAndValueDescriptor(deviceId, valueDescriptor string, limit int) ([]contract.Reading, error)

Return a list of readings for a device filtered by the value descriptor and limited by the limit The readings are linked to the device through an event

func (MongoClient) ReadingsByValueDescriptor

func (mc MongoClient) ReadingsByValueDescriptor(name string, limit int) ([]contract.Reading, error)

Return a list of readings for the given value descriptor Limit by the given limit

func (MongoClient) ReadingsByValueDescriptorNames

func (mc MongoClient) ReadingsByValueDescriptorNames(names []string, limit int) ([]contract.Reading, error)

Return a list of readings whose name is in the list of value descriptor names

func (MongoClient) ScrubAllEvents

func (mc MongoClient) ScrubAllEvents() error

Delete all of the readings and all of the events

func (MongoClient) ScrubAllIntervalActions

func (mc MongoClient) ScrubAllIntervalActions() (int, error)

Removes all of the Interval Action(s) Returns number of Interval Action(s) removed UnexpectedError - failed to remove all of the Interval and IntervalActions from the database

func (MongoClient) ScrubAllIntervals

func (mc MongoClient) ScrubAllIntervals() (int, error)

Removes all of the Intervals Removes any IntervalAction(s) previously not removed as well Returns number Interval(s) removed UnexpectedError - failed to remove all of the Interval and IntervalActions from the database

func (MongoClient) ScrubAllValueDescriptors

func (mc MongoClient) ScrubAllValueDescriptors() error

Delete all of the value descriptors

func (MongoClient) ScrubMetadata

func (mc MongoClient) ScrubMetadata() error

Scrub all metadata

func (MongoClient) UpdateAddressable

func (mc MongoClient) UpdateAddressable(a contract.Addressable) error

func (MongoClient) UpdateDevice

func (mc MongoClient) UpdateDevice(d contract.Device) error

func (MongoClient) UpdateDeviceProfile

func (mc MongoClient) UpdateDeviceProfile(dp contract.DeviceProfile) error

func (MongoClient) UpdateDeviceReport

func (mc MongoClient) UpdateDeviceReport(dr contract.DeviceReport) error

func (MongoClient) UpdateDeviceService

func (mc MongoClient) UpdateDeviceService(ds contract.DeviceService) error

func (MongoClient) UpdateEvent

func (mc MongoClient) UpdateEvent(e correlation.Event) error

Update an event - do NOT update readings UnexpectedError - problem updating in database NotFound - no event with the ID was found

func (MongoClient) UpdateInterval

func (mc MongoClient) UpdateInterval(interval contract.Interval) error

Update an Interval UnexpectedError - failed to update interval in the database

func (MongoClient) UpdateIntervalAction

func (mc MongoClient) UpdateIntervalAction(action contract.IntervalAction) error

Update an Interval Action UnexpectedError - failed to update interval action in the database

func (MongoClient) UpdateNotification

func (mc MongoClient) UpdateNotification(n contract.Notification) error

func (MongoClient) UpdateProvisionWatcher

func (mc MongoClient) UpdateProvisionWatcher(pw contract.ProvisionWatcher) error

func (MongoClient) UpdateReading

func (mc MongoClient) UpdateReading(r contract.Reading) error

Update a reading 404 - reading cannot be found 409 - Value descriptor doesn't exist 503 - unknown issues

func (MongoClient) UpdateSubscription

func (mc MongoClient) UpdateSubscription(sub contract.Subscription) error

func (MongoClient) UpdateTransmission

func (mc MongoClient) UpdateTransmission(t contract.Transmission) error

func (MongoClient) UpdateValueDescriptor

func (mc MongoClient) UpdateValueDescriptor(cvd contract.ValueDescriptor) error

Update a value descriptor First use the ID for identification, then the name TODO: Check for the valid printf formatting 404 not found if the value descriptor cannot be found by the identifiers

func (MongoClient) ValueDescriptorById

func (mc MongoClient) ValueDescriptorById(id string) (contract.ValueDescriptor, error)

Return a value descriptor based on the id Return NotFoundError if there is no value descriptor for the id

func (MongoClient) ValueDescriptorByName

func (mc MongoClient) ValueDescriptorByName(name string) (contract.ValueDescriptor, error)

Return a value descriptor based on the name Can return null if no value descriptor is found

func (MongoClient) ValueDescriptors

func (mc MongoClient) ValueDescriptors() ([]contract.ValueDescriptor, error)

Return a list of all the value descriptors 513 Service Unavailable - database problems

func (MongoClient) ValueDescriptorsByLabel

func (mc MongoClient) ValueDescriptorsByLabel(label string) ([]contract.ValueDescriptor, error)

Return value descriptors based on if it has the label

func (MongoClient) ValueDescriptorsByName

func (mc MongoClient) ValueDescriptorsByName(names []string) ([]contract.ValueDescriptor, error)

Return all of the value descriptors based on the names

func (MongoClient) ValueDescriptorsByType

func (mc MongoClient) ValueDescriptorsByType(t string) ([]contract.ValueDescriptor, error)

Return value descriptors based on the type

func (MongoClient) ValueDescriptorsByUomLabel

func (mc MongoClient) ValueDescriptorsByUomLabel(uomLabel string) ([]contract.ValueDescriptor, error)

Return all the value descriptors that match the UOM label

Directories

Path Synopsis
Package models provides an internal representation of data structures that can be used when interacting with MongoDB.
Package models provides an internal representation of data structures that can be used when interacting with MongoDB.

Jump to

Keyboard shortcuts

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