Documentation ¶
Index ¶
- Constants
- type Store
- func (mem *Store) DeviceEnroll(device datastore.DeviceEnrollRequest) (*domain.Enrollment, error)
- func (mem *Store) DeviceGet(brand, model, serial string) (*domain.Enrollment, error)
- func (mem *Store) DeviceGetByID(deviceID string) (*domain.Enrollment, error)
- func (mem *Store) DeviceList(orgID string) ([]domain.Enrollment, error)
- func (mem *Store) DeviceNew(device datastore.DeviceNewRequest) (string, error)
- func (mem *Store) DeviceUpdate(deviceID string, status domain.Status, deviceData string) error
- func (mem *Store) OrganizationGet(id string) (*domain.Organization, error)
- func (mem *Store) OrganizationGetByName(name string) (*domain.Organization, error)
- func (mem *Store) OrganizationList() ([]domain.Organization, error)
- func (mem *Store) OrganizationNew(organization datastore.OrganizationNewRequest) (string, error)
Constants ¶
View Source
const CertPEM = `` /* 988-byte string literal not displayed */
CertPEM is a test CA
View Source
const RootPEM = `` /* 1678-byte string literal not displayed */
RootPEM is a test CA key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { Orgs []domain.Organization Roll []domain.Enrollment }
Store implements an in-memory store for testing
func (*Store) DeviceEnroll ¶
func (mem *Store) DeviceEnroll(device datastore.DeviceEnrollRequest) (*domain.Enrollment, error)
DeviceEnroll enrols a device with the IoT service
func (*Store) DeviceGet ¶
func (mem *Store) DeviceGet(brand, model, serial string) (*domain.Enrollment, error)
DeviceGet fetches a device registration
func (*Store) DeviceGetByID ¶
func (mem *Store) DeviceGetByID(deviceID string) (*domain.Enrollment, error)
DeviceGetByID fetches a device by its ID
func (*Store) DeviceList ¶
func (mem *Store) DeviceList(orgID string) ([]domain.Enrollment, error)
DeviceList fetches the devices for an organization
func (*Store) DeviceNew ¶
func (mem *Store) DeviceNew(device datastore.DeviceNewRequest) (string, error)
DeviceNew creates a new device registration
func (*Store) DeviceUpdate ¶
DeviceUpdate update a device for selected fields
func (*Store) OrganizationGet ¶
func (mem *Store) OrganizationGet(id string) (*domain.Organization, error)
OrganizationGet fetches an organization by ID
func (*Store) OrganizationGetByName ¶
func (mem *Store) OrganizationGetByName(name string) (*domain.Organization, error)
OrganizationGetByName fetches an organization by name
func (*Store) OrganizationList ¶
func (mem *Store) OrganizationList() ([]domain.Organization, error)
OrganizationList lists existing organizations
func (*Store) OrganizationNew ¶
func (mem *Store) OrganizationNew(organization datastore.OrganizationNewRequest) (string, error)
OrganizationNew creates a new organization
Click to show internal directories.
Click to hide internal directories.