Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPasswordCost = 12 DefaultExpirationDelta = 30 * 24 * time.Hour )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Model User User `json:"user" gorm:"foreignKey:UserUUID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` UserUUID uuid.UUID `json:"userUUID" gorm:"uniqueIndex:idx_unique_alarm;not null;"` Name string `json:"name" gorm:"uniqueIndex:idx_unique_alarm;not null;"` Sensor Sensor `json:"sensor" gorm:"foreignKey:SensorUUID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` SensorUUID uuid.UUID `json:"sensorUUID" gorm:"not null;"` ConditionOP string `json:"conditionOP" gorm:"-"` Condition Condition `json:"-" gorm:"not null;"` Value float64 `json:"value" gorm:"not null;"` }
func RandomAlert ¶
type Model ¶
type Sensor ¶
type Sensor struct { Model Station Station `json:"station" gorm:"foreignKey:StationUUID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` StationUUID uuid.UUID `json:"stationUUID" gorm:"uniqueIndex:idx_unique_sensor;not null;"` Type string `json:"type" gorm:"uniqueIndex:idx_unique_sensor;not null;"` Registries []SensorRegistry `json:"registries"` }
func RandomSensor ¶
type SensorRegistry ¶
type Station ¶
type Station struct { Model User User `json:"user" gorm:"foreignKey:UserUUID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` UserUUID uuid.UUID `json:"userUUID" gorm:"uniqueIndex:idx_unique_station;not null;"` Name string `json:"name" gorm:"uniqueIndex:idx_unique_station;not null;"` CountryName string `json:"countryName" gorm:"-"` SubdivisionName string `json:"subdivisionName" gorm:"-"` Country countries.CountryCode `json:"-" gorm:"not null;"` Subdivision countries.SubdivisionCode `json:"-" gorm:"not null"` Description string `json:"description"` Latitude float64 `json:"latitude" gorm:"not null;"` Longitude float64 `json:"longitude" gorm:"not null;"` Sensors []Sensor `json:"sensors"` }
func RandomStation ¶
type User ¶
type User struct { Model Username string `json:"username" gorm:"unique;not null;"` Password string `json:"password" gorm:"-"` PasswordHash []byte `json:"-" gorm:"not null;"` Name string `json:"name" gorm:"not null"` Phone string `json:"phone" gorm:"unique;not null"` Email string `json:"email" gorm:"unique;not null"` Confirmed bool `json:"confimed" gorm:"not null;default:FALSE;"` Stations []Station `json:"stations"` }
func RandomUser ¶
func RandomUser() *User
func (*User) Authenticate ¶
func (*User) FromClaims ¶
Click to show internal directories.
Click to hide internal directories.