Documentation
¶
Overview ¶
Package datastore contains the interface and implementations for the data store backends
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = log.StandardLogger()
Logger is an exported logger specific to the Datastore package, it could be swapped out for another logger
Functions ¶
Types ¶
type DataStore ¶
type DataStore interface { OrganizationNew(organization OrganizationNewRequest) (string, error) OrganizationGet(id string) (*domain.Organization, error) OrganizationGetByName(name string) (*domain.Organization, error) OrganizationList() ([]domain.Organization, error) DeviceNew(device DeviceNewRequest) (string, error) DeviceGet(brand, model, serial string) (*domain.Enrollment, error) DeviceGetByID(deviceID string) (*domain.Enrollment, error) DeviceEnroll(device DeviceEnrollRequest) (*domain.Enrollment, error) DeviceList(orgID string) ([]domain.Enrollment, error) DeviceUpdate(deviceID string, status domain.Status, deviceData string) error DeviceDelete(deviceID string) (string, error) }
DataStore is the interfaces for the data repository
type DeviceEnrollRequest ¶
type DeviceEnrollRequest struct { Brand string Model string SerialNumber string DeviceKey string StoreID string }
DeviceEnrollRequest is the request to enroll a device. The details come from the model and serial assertion
type DeviceNewRequest ¶
type DeviceNewRequest struct { ID string OrganizationID string Brand string Model string SerialNumber string Credentials domain.Credentials DeviceData string }
DeviceNewRequest is the request to create a new device
Directories
¶
Path | Synopsis |
---|---|
Package memory is an implementation of a in-memory only datastore
|
Package memory is an implementation of a in-memory only datastore |
Package postgres implements a datastore using the postgres database
|
Package postgres implements a datastore using the postgres database |
Click to show internal directories.
Click to hide internal directories.