types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: GPL-3.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	fulfillment.Device `bson:",inline"`
	PublicKeyBase64    string `bson:"publickey"`
}

Device is device from database

type DevicePermissions

type DevicePermissions struct {
	Read    bool
	Write   bool
	Execute bool
}

DevicePermissions defines what user can and cannot

type DeviceRequest

type DeviceRequest struct {
	Params  map[string]interface{} `json:"params,omitempty"`
	Command string                 `json:"command"`
}

DeviceRequest is type of request incoming to the device

type DeviceResponse

type DeviceResponse struct {
	State  map[string]interface{} `json:"state"`
	Status string                 `json:"status"`
	Error  string                 `json:"error,omitempty"`
}

DeviceResponse is type of response coming out of the device

type ResponseError

type ResponseError struct {
	Name        string `json:"error"`
	Description string `json:"error_description,omitempty"`
	StatusCode  int    `json:"-"`
}

ResponseError is used to return it for example from some HTTP route

type User

type User struct {
	ID           string `json:"id" form:"-"`
	FirstName    string `json:"firstName" form:"firstName" binding:"required"`
	LastName     string `json:"lastName" form:"lastName" binding:"required"`
	Email        string `json:"email" houseflow:"email" form:"email" binding:"required,email"`
	Password     string `json:"password" form:"password" binding:"required,min=8,max=20"`
	PasswordHash []byte `json:"-" form:"-"`
}

User struct, used to either creating user, or this one in DB

Jump to

Keyboard shortcuts

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