datastore

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() string

GenerateID generates a unique ID

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
}

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

type OrganizationNewRequest

type OrganizationNewRequest struct {
	Name        string
	CountryName string
	ServerKey   []byte
	ServerCert  []byte
}

OrganizationNewRequest is the request to create a new organization

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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