Documentation
¶
Index ¶
Constants ¶
View Source
const DevicesCollection = "devices"
View Source
const FleetsCollection = "fleets"
View Source
const LocationsCollection = "locations"
View Source
const SigfoxMessagesCollection = "sigfox_messages"
View Source
const SigfoxSyntaxesCollection = "sigfoxSyntaxes"
View Source
const UsersCollection = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
UserId string `json:"userId" bson:"userId" valid:"-"`
Name string `json:"name" bson:"name" valid:"-"`
SigfoxId string `json:"sigfoxId" bson:"sigfoxId" valid:"-"`
BLEMac string `json:"bleMac" bson:"bleMac" valid:"-"`
LastAcc int64 `json:"lastAcc" bson:"lastAcc" valid:"-"`
Active bool `json:"active" bson:"active" valid:"-"`
}
func (*Device) BeforeCreate ¶
func (d *Device) BeforeCreate()
type Fleet ¶
type Fleet struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
UserId string `json:"userId" bson:"userId" valid:"-"`
Name string `json:"name" bson:"name"`
DeviceIds []string `json:"device_ids" bson:"device_ids"`
LastAcc int64 `json:"lastAcc" bson:"lastAcc" valid:"-"`
Active bool `json:"active" bson:"active" valid:"-"`
}
func (*Fleet) BeforeCreate ¶
func (d *Fleet) BeforeCreate()
type LastLocation ¶
type Location ¶
type Location struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
SigfoxId string `json:"sigfoxId" bson:"sigfoxId" valid:"-"`
FrameNumber uint `json:"frameNumber" bson:"frameNumber" valid:"-"` //Device : (daily frames under 140)
Timestamp int64 `json:"timestamp" bson:"timestamp" valid:"-"`
Latitude float64 `json:"latitude" bson:"latitude" valid:"-"`
Longitude float64 `json:"longitude" bson:"longitude" valid:"-"`
Radius float64 `json:"radius" bson:"radius" valid:"-"`
SpotIt bool `json:"spotIt" bson:"spotIt" valid:"-"`
GPS bool `json:"gps" bson:"gps" valid:"-"`
WiFi bool `json:"wifi" bson:"wifi" valid:"-"`
}
func (*Location) BeforeCreate ¶
func (l *Location) BeforeCreate()
type LoginToken ¶
type SanitizedUser ¶
type SigfoxMessage ¶
type SigfoxMessage struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
SigfoxId string `json:"sigfoxId" bson:"sigfoxId" valid:"-"`
FrameNumber uint `json:"frameNumber" bson:"frameNumber" valid:"-"` //Device : (daily frames under 140)
Timestamp int64 `json:"timestamp" bson:"timestamp" valid:"-"` //Sigfox : time
Station string `json:"station" bson:"station" valid:"-"` //Sigfox : station
Snr float64 `json:"snr" bson:"snr" valid:"-"` //Sigfox : snr
AvgSnr float64 `json:"avgSnr" bson:"avgSnr" valid:"-"` //Sigfox : avgSnr
Rssi float64 `json:"rssi" bson:"rssi" valid:"-"` //Sigfox : rssi
MesType uint8 `json:"mesType" bson:"mesType" valid:"-"` //Sigfox : mesType
Data string `json:"data" bson:"data" valid:"-"` //Sigfox : data
EventType string `json:"eventType" bson:"eventType" valid:"-"` //Device : eventType
SwRev string `json:"swRev" bson:"swRev" valid:"-"` //Device : swRev
Mode string `json:"mode" bson:"mode" valid:"-"` //Device : mode
Timeframe string `json:"timeframe" bson:"timeframe" valid:"-"` //Device : timeframe
Data1 float64 `json:"data1" bson:"data1" valid:"-"` //Device : battery
Data2 float64 `json:"data2" bson:"data2" valid:"-"` //Device : temperature
Data3 float64 `json:"data3" bson:"data3" valid:"-"` //Device : humidity
Data4 float64 `json:"data4" bson:"data4" valid:"-"` //Device : light
Data5 float64 `json:"data5" bson:"data5" valid:"-"` //Device : custom
Data6 float64 `json:"data6" bson:"data6" valid:"-"` //Device : custom
Alerts int64 `json:"alerts" bson:"alerts" valid:"-"` //Device : alerts
}
func NewStoreController() UserController {
return UserController{}
}
func (*SigfoxMessage) BeforeCreate ¶
func (mes *SigfoxMessage) BeforeCreate()
MesType, 1=Sensit, 2=Arduino, 3= Wisol EVK
func (*SigfoxMessage) FormatData ¶
func (l *SigfoxMessage) FormatData(valueType string) gin.H
type SigfoxSyntax ¶
type SigfoxSyntax struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
FleetId string `json:"fleetId" bson:"fleetId" valid:"-"`
LastAcc int64 `json:"lastAcc" bson:"lastAcc" valid:"-"`
}
func (*SigfoxSyntax) BeforeCreate ¶
func (d *SigfoxSyntax) BeforeCreate()
type User ¶
type User struct {
Id string `json:"id" bson:"_id,omitempty" valid:"-"`
Firstname string `json:"firstname" bson:"firstname"`
Lastname string `json:"lastname" bson:"lastname"`
Password string `json:"password" bson:"password" valid:"required"`
Email string `json:"email" bson:"email" valid:"email,required"`
Phone string `json:"phone" bson:"phone"`
Active bool `json:"active" bson:"active"`
ActivationKey string `json:"activationKey" bson:"activationKey"`
ResetKey string `json:"resetKey" bson:"resetKey"`
StripeId string `json:"stripeId" bson:"stripeId"`
Admin bool `json:"admin" bson:"admin"`
Tokens []LoginToken `json:"tokens" bson:"tokens"`
}
func (*User) BeforeCreate ¶
func (*User) Sanitize ¶
func (user *User) Sanitize() SanitizedUser
Click to show internal directories.
Click to hide internal directories.