bolt

package
v0.0.0-...-0fdedec Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

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

  • 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 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 Circutor S.A. *
  • 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 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 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. ******************************************************************************

Index

Constants

View Source
const (
	ExportCollection = "export"
)

Variables

View Source
var ErrLimReached error = errors.New("Limit reached")
View Source
var ErrObjFound error = errors.New("Object name found")

Functions

This section is empty.

Types

type BoltClient

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

func NewClient

func NewClient(config db.Configuration) (*BoltClient, error)

Return a pointer to the BoltClient

func (*BoltClient) AddAddressable

func (bc *BoltClient) AddAddressable(a models.Addressable) (string, error)

func (*BoltClient) AddCommand

func (bc *BoltClient) AddCommand(c models.Command) (string, error)

func (*BoltClient) AddDevice

func (bc *BoltClient) AddDevice(d models.Device) (string, error)

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

func (*BoltClient) AddDeviceProfile

func (bc *BoltClient) AddDeviceProfile(dp models.DeviceProfile) (string, error)

func (*BoltClient) AddDeviceService

func (bc *BoltClient) AddDeviceService(ds models.DeviceService) (string, error)

func (*BoltClient) AddEvent

func (bc *BoltClient) AddEvent(e contract.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 (*BoltClient) AddInterval

func (bc *BoltClient) AddInterval(interval contract.Interval) (string, error)

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

func (*BoltClient) AddIntervalAction

func (bc *BoltClient) AddIntervalAction(action contract.IntervalAction) (string, error)

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

func (*BoltClient) AddProvisionWatcher

func (bc *BoltClient) AddProvisionWatcher(pw models.ProvisionWatcher) (string, error)

func (*BoltClient) AddReading

func (bc *BoltClient) AddReading(r contract.Reading) (string, error)

Post a new reading

func (*BoltClient) AddRegistration

func (bc *BoltClient) AddRegistration(reg contract.Registration) (string, error)

Add a new registration UnexpectedError - failed to add to database

func (*BoltClient) CloseSession

func (bc *BoltClient) CloseSession()

func (*BoltClient) Connect

func (bc *BoltClient) Connect() error

func (*BoltClient) DeleteAddressableById

func (bc *BoltClient) DeleteAddressableById(id string) error

func (*BoltClient) DeleteCommandById

func (bc *BoltClient) DeleteCommandById(id string) error

func (*BoltClient) DeleteDeviceById

func (bc *BoltClient) DeleteDeviceById(id string) error

func (*BoltClient) DeleteDeviceProfileById

func (bc *BoltClient) DeleteDeviceProfileById(id string) error

func (*BoltClient) DeleteDeviceServiceById

func (bc *BoltClient) DeleteDeviceServiceById(id string) error

func (*BoltClient) DeleteEventById

func (bc *BoltClient) DeleteEventById(id string) error

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

func (*BoltClient) DeleteIntervalActionById

func (bc *BoltClient) DeleteIntervalActionById(id string) error

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

func (*BoltClient) DeleteIntervalById

func (bc *BoltClient) DeleteIntervalById(id string) error

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

func (*BoltClient) DeleteProvisionWatcherById

func (bc *BoltClient) DeleteProvisionWatcherById(id string) error

func (*BoltClient) DeleteReadingById

func (bc *BoltClient) DeleteReadingById(id string) error

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

func (*BoltClient) DeleteRegistrationById

func (bc *BoltClient) DeleteRegistrationById(id string) error

Delete a registration by ID UnexpectedError - problem getting in database NotFound - no registration with the ID was found

func (*BoltClient) DeleteRegistrationByName

func (bc *BoltClient) DeleteRegistrationByName(name string) error

Delete a registration by name UnexpectedError - problem getting in database NotFound - no registration with the ID was found

func (*BoltClient) EventById

func (bc *BoltClient) EventById(id string) (contract.Event, error)

Get an event by id

func (*BoltClient) EventCount

func (bc *BoltClient) EventCount() (int, error)

Get the number of events in bolt

func (*BoltClient) EventCountByDeviceId

func (bc *BoltClient) EventCountByDeviceId(devid string) (int, error)

Get the number of events in bolt for the device

func (*BoltClient) Events

func (bc *BoltClient) 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 (*BoltClient) EventsByCreationTime

func (bc *BoltClient) EventsByCreationTime(startTime, endTime int64, limit int) ([]contract.Event, error)

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

func (*BoltClient) EventsForDevice

func (bc *BoltClient) EventsForDevice(ide string) ([]contract.Event, error)

Get a list of events based on the device id

func (*BoltClient) EventsForDeviceLimit

func (bc *BoltClient) EventsForDeviceLimit(ide string, limit int) ([]contract.Event, error)

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

func (*BoltClient) EventsOlderThanAge

func (bc *BoltClient) EventsOlderThanAge(age int64) ([]contract.Event, error)

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

func (*BoltClient) EventsPushed

func (bc *BoltClient) EventsPushed() ([]contract.Event, error)

Get all of the events that have been pushed

func (*BoltClient) EventsWithLimit

func (bc *BoltClient) 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 (*BoltClient) GetAddressableById

func (bc *BoltClient) GetAddressableById(id string) (models.Addressable, error)

func (*BoltClient) GetAddressableByName

func (bc *BoltClient) GetAddressableByName(name string) (models.Addressable, error)

func (*BoltClient) GetAddressables

func (bc *BoltClient) GetAddressables() ([]models.Addressable, error)

func (*BoltClient) GetAddressablesByAddress

func (bc *BoltClient) GetAddressablesByAddress(address string) ([]models.Addressable, error)

func (*BoltClient) GetAddressablesByPort

func (bc *BoltClient) GetAddressablesByPort(port int) ([]models.Addressable, error)

func (*BoltClient) GetAddressablesByPublisher

func (bc *BoltClient) GetAddressablesByPublisher(publisher string) ([]models.Addressable, error)

func (*BoltClient) GetAddressablesByTopic

func (bc *BoltClient) GetAddressablesByTopic(topic string) ([]models.Addressable, error)

func (*BoltClient) GetAllCommands

func (bc *BoltClient) GetAllCommands() ([]models.Command, error)

------------------------Command -------------------------------------*/

func (*BoltClient) GetAllDeviceProfiles

func (bc *BoltClient) GetAllDeviceProfiles() ([]models.DeviceProfile, error)

func (*BoltClient) GetAllDeviceServices

func (bc *BoltClient) GetAllDeviceServices() ([]models.DeviceService, error)

func (*BoltClient) GetAllDevices

func (bc *BoltClient) GetAllDevices() ([]models.Device, error)

func (*BoltClient) GetAllProvisionWatchers

func (bc *BoltClient) GetAllProvisionWatchers() ([]models.ProvisionWatcher, error)

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

func (*BoltClient) GetCommandById

func (bc *BoltClient) GetCommandById(id string) (models.Command, error)

func (*BoltClient) GetCommandByName

func (bc *BoltClient) GetCommandByName(name string) ([]models.Command, error)

func (*BoltClient) GetDeviceById

func (bc *BoltClient) GetDeviceById(id string) (models.Device, error)

func (*BoltClient) GetDeviceByName

func (bc *BoltClient) GetDeviceByName(name string) (models.Device, error)

func (*BoltClient) GetDeviceProfileById

func (bc *BoltClient) GetDeviceProfileById(id string) (models.DeviceProfile, error)

-----------------------------Device Profile -----------------------------

func (*BoltClient) GetDeviceProfileByName

func (bc *BoltClient) GetDeviceProfileByName(name string) (models.DeviceProfile, error)

func (*BoltClient) GetDeviceProfilesByCommandId

func (bc *BoltClient) GetDeviceProfilesByCommandId(id string) ([]models.DeviceProfile, error)

Get the device profiles that are currently using the command

func (*BoltClient) GetDeviceProfilesByManufacturer

func (bc *BoltClient) GetDeviceProfilesByManufacturer(man string) ([]models.DeviceProfile, error)

func (*BoltClient) GetDeviceProfilesByManufacturerModel

func (bc *BoltClient) GetDeviceProfilesByManufacturerModel(man string, mod string) ([]models.DeviceProfile, error)

func (*BoltClient) GetDeviceProfilesByModel

func (bc *BoltClient) GetDeviceProfilesByModel(model string) ([]models.DeviceProfile, error)

func (*BoltClient) GetDeviceProfilesWithLabel

func (bc *BoltClient) GetDeviceProfilesWithLabel(label string) ([]models.DeviceProfile, error)

func (*BoltClient) GetDeviceServiceById

func (bc *BoltClient) GetDeviceServiceById(id string) (models.DeviceService, error)

func (*BoltClient) GetDeviceServiceByName

func (bc *BoltClient) GetDeviceServiceByName(name string) (models.DeviceService, error)

----------------------------- Device Service ----------------------------------

func (*BoltClient) GetDeviceServicesByAddressableId

func (bc *BoltClient) GetDeviceServicesByAddressableId(id string) ([]models.DeviceService, error)

func (*BoltClient) GetDeviceServicesWithLabel

func (bc *BoltClient) GetDeviceServicesWithLabel(label string) ([]models.DeviceService, error)

func (*BoltClient) GetDevicesByAddressableId

func (bc *BoltClient) GetDevicesByAddressableId(aid string) ([]models.Device, error)

func (*BoltClient) GetDevicesByProfileId

func (bc *BoltClient) GetDevicesByProfileId(pid string) ([]models.Device, error)

func (*BoltClient) GetDevicesByServiceId

func (bc *BoltClient) GetDevicesByServiceId(sid string) ([]models.Device, error)

func (*BoltClient) GetDevicesWithLabel

func (bc *BoltClient) GetDevicesWithLabel(label string) ([]models.Device, error)

func (*BoltClient) GetProvisionWatcherById

func (bc *BoltClient) GetProvisionWatcherById(id string) (models.ProvisionWatcher, error)

func (*BoltClient) GetProvisionWatcherByName

func (bc *BoltClient) GetProvisionWatcherByName(name string) (models.ProvisionWatcher, error)

func (*BoltClient) GetProvisionWatchersByIdentifier

func (bc *BoltClient) GetProvisionWatchersByIdentifier(k string, v string) ([]models.ProvisionWatcher, error)

func (*BoltClient) GetProvisionWatchersByProfileId

func (bc *BoltClient) GetProvisionWatchersByProfileId(id string) ([]models.ProvisionWatcher, error)

func (*BoltClient) GetProvisionWatchersByServiceId

func (bc *BoltClient) GetProvisionWatchersByServiceId(id string) ([]models.ProvisionWatcher, error)

func (*BoltClient) IntervalActionById

func (bc *BoltClient) 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 (*BoltClient) IntervalActionByName

func (bc *BoltClient) 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 (*BoltClient) IntervalActions

func (bc *BoltClient) 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 (*BoltClient) IntervalActionsByIntervalName

func (bc *BoltClient) 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 (*BoltClient) IntervalActionsByTarget

func (bc *BoltClient) IntervalActionsByTarget(target 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 (*BoltClient) IntervalActionsWithLimit

func (bc *BoltClient) 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 (*BoltClient) IntervalById

func (bc *BoltClient) IntervalById(id string) (contract.Interval, error)

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

func (*BoltClient) IntervalByName

func (bc *BoltClient) IntervalByName(name string) (contract.Interval, error)

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

func (*BoltClient) Intervals

func (bc *BoltClient) Intervals() ([]contract.Interval, error)

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

func (*BoltClient) IntervalsWithLimit

func (bc *BoltClient) 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 (*BoltClient) ReadingById

func (bc *BoltClient) ReadingById(id string) (contract.Reading, error)

Get a reading by ID

func (*BoltClient) ReadingCount

func (bc *BoltClient) ReadingCount() (int, error)

Get the count of readings in BOLT

func (*BoltClient) Readings

func (bc *BoltClient) Readings() ([]contract.Reading, error)

Return a list of readings sorted by reading id

func (*BoltClient) ReadingsByCreationTime

func (bc *BoltClient) ReadingsByCreationTime(start, end int64, limit int) ([]contract.Reading, error)

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

func (*BoltClient) ReadingsByDevice

func (bc *BoltClient) ReadingsByDevice(ids 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 (*BoltClient) ReadingsByDeviceAndValueDescriptor

func (bc *BoltClient) 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 (*BoltClient) ReadingsByValueDescriptor

func (bc *BoltClient) ReadingsByValueDescriptor(name string, limit int) ([]contract.Reading, error)

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

func (*BoltClient) RegistrationById

func (bc *BoltClient) RegistrationById(id string) (contract.Registration, error)

Get a registration by ID UnexpectedError - problem getting in database NotFound - no registration with the ID was found

func (*BoltClient) RegistrationByName

func (bc *BoltClient) RegistrationByName(name string) (contract.Registration, error)

Get a registration by name UnexpectedError - problem getting in database NotFound - no registration with the name was found

func (*BoltClient) Registrations

func (bc *BoltClient) Registrations() ([]contract.Registration, error)

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

func (*BoltClient) ScrubAllEvents

func (bc *BoltClient) ScrubAllEvents() error

Delete all of the readings and all of the events

func (*BoltClient) ScrubAllIntervalActions

func (bc *BoltClient) 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 (*BoltClient) ScrubAllIntervals

func (bc *BoltClient) 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 (*BoltClient) ScrubAllRegistrations

func (bc *BoltClient) ScrubAllRegistrations() error

Delete all registrations

func (*BoltClient) ScrubMetadata

func (bc *BoltClient) ScrubMetadata() error

Scrub all metadata

func (*BoltClient) UpdateAddressable

func (bc *BoltClient) UpdateAddressable(a models.Addressable) error

-----------------------------------Addressable --------------------------*/

func (*BoltClient) UpdateCommand

func (bc *BoltClient) UpdateCommand(c models.Command) error

func (*BoltClient) UpdateDevice

func (bc *BoltClient) UpdateDevice(d models.Device) error

func (*BoltClient) UpdateDeviceProfile

func (bc *BoltClient) UpdateDeviceProfile(dp models.DeviceProfile) error

func (*BoltClient) UpdateDeviceService

func (bc *BoltClient) UpdateDeviceService(ds models.DeviceService) error

func (*BoltClient) UpdateEvent

func (bc *BoltClient) UpdateEvent(e contract.Event) error

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

func (*BoltClient) UpdateInterval

func (bc *BoltClient) UpdateInterval(interval contract.Interval) error

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

func (*BoltClient) UpdateIntervalAction

func (bc *BoltClient) UpdateIntervalAction(action contract.IntervalAction) error

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

func (*BoltClient) UpdateProvisionWatcher

func (bc *BoltClient) UpdateProvisionWatcher(pw models.ProvisionWatcher) error

func (*BoltClient) UpdateReading

func (bc *BoltClient) UpdateReading(r contract.Reading) error

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

func (*BoltClient) UpdateRegistration

func (bc *BoltClient) UpdateRegistration(reg contract.Registration) error

Update a registration UnexpectedError - problem updating in database NotFound - no registration with the ID was found

Jump to

Keyboard shortcuts

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