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

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

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




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


This section is empty.


This section is empty.


type Store

type Store struct {
	Orgs []domain.Organization
	Roll []domain.Enrollment

Store implements an in-memory store for testing

func NewStore

func NewStore() *Store

NewStore creates a new memory store

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

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

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

Jump to

Keyboard shortcuts

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