couch

package
v0.0.0-...-eeaa3c5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(addr, user, pass string) (*Service, error)

New takes an address, username, and password for the desired couchdb and returns a new service backed by that datastore

func (*Service) GetConfig

func (s *Service) GetConfig(id string) (interface{}, error)

func (*Service) GetDevice

func (s *Service) GetDevice(deviceID string) (shipyard.Device, error)

func (*Service) GetDeviceTemplate

func (s *Service) GetDeviceTemplate(id string) (shipyard.DeviceTemplate, error)

GetDeviceTemplate returns the requested device template from couch

func (*Service) GetRoom

func (s *Service) GetRoom(roomID string) (shipyard.Room, error)

GetRoom returns the room matching the requested ID

func (*Service) GetRoomDevices

func (s *Service) GetRoomDevices(roomID string) ([]shipyard.Device, error)

func (*Service) GetUIConfig

func (s *Service) GetUIConfig(roomID string) (shipyard.UIConfig, error)

func (*Service) ListAllRooms

func (s *Service) ListAllRooms() ([]string, error)

ListAllRooms returns a list of all the rooms that exist

func (*Service) ListDeviceTemplates

func (s *Service) ListDeviceTemplates() ([]string, error)

ListDeviceTemplates lists the ids of all the templates currently found in couch

func (*Service) ListRoomDevices

func (s *Service) ListRoomDevices(roomID string) ([]string, error)

func (*Service) SaveControlDoc

func (s *Service) SaveControlDoc(doc shipyard.RoomControlDoc) error

func (*Service) SaveDevice

func (s *Service) SaveDevice(dev shipyard.Device) error

func (*Service) SaveRoom

func (s *Service) SaveRoom(r shipyard.Room) error

SaveRoom saves the given room to couch by either updating an existing entry or creating a new document in the database

func (*Service) SaveUIConfig

func (s *Service) SaveUIConfig(config shipyard.UIConfig) error

Jump to

Keyboard shortcuts

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