postgres

package
Version: v0.0.0-...-6e89ea1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	*sql.DB
	// contains filtered or unexported fields
}

Store implements a PostgreSQL data store

func OpenStore

func OpenStore(driver, dataSource string) *Store

OpenStore returns an open database connection

func (*Store) DeviceEnroll

func (db *Store) DeviceEnroll(d datastore.DeviceEnrollRequest) (*domain.Enrollment, error)

DeviceEnroll enrolls a device with the IoT service

func (*Store) DeviceGet

func (db *Store) DeviceGet(brand, model, serial string) (*domain.Enrollment, error)

DeviceGet fetches a device registration

func (*Store) DeviceGetByID

func (db *Store) DeviceGetByID(deviceID string) (*domain.Enrollment, error)

DeviceGetByID fetches a device registration

func (*Store) DeviceList

func (db *Store) DeviceList(orgID string) ([]domain.Enrollment, error)

DeviceList fetches the device registrations for an organization

func (*Store) DeviceNew

func (db *Store) DeviceNew(d datastore.DeviceNewRequest) (string, error)

DeviceNew creates a new device registration

func (*Store) DeviceUpdate

func (db *Store) DeviceUpdate(deviceID string, status domain.Status, deviceData string) error

DeviceUpdate updates a device registration

func (*Store) OrganizationGet

func (db *Store) OrganizationGet(orgID string) (*domain.Organization, error)

OrganizationGet fetches an organization by ID

func (*Store) OrganizationGetByName

func (db *Store) OrganizationGetByName(name string) (*domain.Organization, error)

OrganizationGetByName fetches an organization by name

func (*Store) OrganizationList

func (db *Store) OrganizationList() ([]domain.Organization, error)

OrganizationList fetches existing organizations

func (*Store) OrganizationNew

func (db *Store) OrganizationNew(org datastore.OrganizationNewRequest) (string, error)

OrganizationNew creates a new organization

Jump to

Keyboard shortcuts

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