iot

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(id int) goald.IUser

TODO remove once we have an ORM

Types

type BootstrapStatus

type BootstrapStatus int
const (
	BootstrapStatusACCESSxDENIED      BootstrapStatus = -1
	BootstrapStatusAUTHENTICATEDxONLY BootstrapStatus = 1
	BootstrapStatusPENDING            BootstrapStatus = 2
	BootstrapStatusREADY              BootstrapStatus = 3
)

func (BootstrapStatus) String

func (thisBootstrapStatus BootstrapStatus) String() string

func (BootstrapStatus) Val

func (thisBootstrapStatus BootstrapStatus) Val() int

Val helps implement the IEnum interface

func (BootstrapStatus) Values

func (thisBootstrapStatus BootstrapStatus) Values() map[int]string

Values helps implement the IEnum interface

type Device

type Device struct {
	goald.BusinessObject
	Status          DeviceStatus  `json:"status"          io:"o*" desc:"the status of the device"`
	StatusString    string        `json:"statusString"    io:"o*" desc:"the status of the device"`
	Model           string        `json:"model"           io:"o*" desc:"the model of the device"`
	Serial          string        `json:"serial"          io:"o*" desc:"the serial number of the device"`
	AssociatedUsers []goald.IUser `json:"associatedUsers" io:"o*" desc:"the users associated with the device"` // removed for now
}

func (*Device) IsUserAssociated

func (thisDevice *Device) IsUserAssociated(user goald.IUser) bool

type DeviceBootstrap

type DeviceBootstrap struct {
	goald.BusinessObject
	Status      BootstrapStatus `json:"status"      io:"o*" desc:"the status of the bootstrap process for this device"`
	IotCertPEM  string          `json:"iotCertPem"  io:"o*" desc:"the IoT certificate in PEM format"`       // once the bootstrap is done in the provisioning service
	IotChainPEM string          `json:"iotChainPem" io:"o*" desc:"the IoT certificate chain in PEM format"` // once the bootstrap is done in the provisioning service
	DeviceID    string          `json:"deviceId"    io:"o*" desc:"the attributed device ID"`                // once the bootstrap is done in the provisioning service
	ScopeID     string          `json:"scopeId"     io:"o*" desc:"the attributed scope ID"`                 // once the bootstrap is done in the provisioning service

}

func GetDeviceBoostrap

func GetDeviceBoostrap(serial string) *DeviceBootstrap

type DeviceBootstrapPayload

type DeviceBootstrapPayload struct {
	goald.BusinessObject
	Serial    string `` /* 133-byte string literal not displayed */
	Model     string `json:"model"     io:"i*" desc:"the model of the device"`
	Timestamp int64  `` /* 137-byte string literal not displayed */
	Nonce     string `json:"nonce"     io:"i*" desc:"the nonce of the payload, to block replays of recent payloads"`
}

func (*DeviceBootstrapPayload) ExistsInDb

func (thisPayload *DeviceBootstrapPayload) ExistsInDb() bool

func (*DeviceBootstrapPayload) InsertInDb

func (thisPayload *DeviceBootstrapPayload) InsertInDb()

type DeviceBootstrapRequest

type DeviceBootstrapRequest struct {
	goald.BusinessObject
	FactoryCertPEM string `` /* 150-byte string literal not displayed */
	PayloadB64     string `json:"payloadB64"     io:"i*" desc:"the base64-encoded payload for the bootstrap request"`
	SignatureB64   string `json:"signatureB64"   io:"i*" desc:"the base64-encoded signature of the payload"`
}

type DeviceLinkRequest

type DeviceLinkRequest struct {
	goald.BusinessObject
	Model            string            `json:"model"            io:"i*" desc:"the model of the device to link"`
	Serial           string            `json:"serial"           io:"i*" desc:"the device serial number"`
	VerificationCode string            `json:"verificationCode" io:"in" desc:"VerificationCode: NOT STABLE, will probably be removed"`
	UserID           int               `json:"userId"           io:"in" desc:"UserID: NOT STABLE, will probably be removed"`
	UserFullName     string            `json:"userFullName"     io:"in" desc:"UserFullName:NOT STABLE, will probably be removed"`
	Users            []goald.IUser     `json:"users"            io:"i*" desc:"the associated user"`
	MainContact      goald.IUser       `json:"mainContact"      io:"in" desc:"the main contact user"`
	ForWho           goald.IUser       `json:"forWho"           io:"i*" desc:"the user for whom the device is being linked"`
	ENTranslation    *i18n.Translation `` /* 136-byte string literal not displayed */
}

type DeviceStatus

type DeviceStatus int
const (
	DeviceStatusFORBIDDEN         DeviceStatus = -2 // The user can't be added to this device and / or this device can't be enrolled
	DeviceStatusBADxDEVICExSERIAL DeviceStatus = -1 // The serial number cannot help us identify a device type
	DeviceStatusLINKED            DeviceStatus = 1  // The user has successfully been associated with this device
	DeviceStatusALREADYxLINKED    DeviceStatus = 2  // The user was already associated with the given device (idempotence).
)

func (DeviceStatus) String

func (thisDeviceStatus DeviceStatus) String() string

func (DeviceStatus) Val

func (thisDeviceStatus DeviceStatus) Val() int

Val helps implement the IEnum interface

func (DeviceStatus) Values

func (thisDeviceStatus DeviceStatus) Values() map[int]string

Values helps implement the IEnum interface

type User

type User struct {
	goald.BusinessObject

	UserFullName string
}

func (*User) GetUsername

func (thisUser *User) GetUsername() string

Directories

Path Synopsis
Generated file, do not edit!
Generated file, do not edit!
clouds

Jump to

Keyboard shortcuts

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