Documentation
¶
Index ¶
- type App
- type AuthPlugin
- type BasicEvent
- type ClientToken
- type DrivingLicense
- type Entities
- type EntityFunc
- type Evaluation
- type EvaluationValue
- type Event
- type EventCreateTree
- type EventDeleteTree
- type EventNewSensorData
- type EventType
- type EventUpdateTree
- type EventUpdateTreeCluster
- type EventUpdateWateringPlan
- type GeoJSON
- type GeoJSONFeature
- type GeoJSONGeometry
- type GeoJSONLocation
- type GeoJSONMetadata
- type GeoJSONType
- type Git
- type IntroSpectTokenResult
- type LoginCallback
- type LoginRequest
- type LoginResp
- type Logout
- type Map
- type MqttPayload
- type Plugin
- type Query
- type Region
- type RegionEvaluation
- type RegisterUser
- type RouteMetadata
- type Sensor
- type SensorCreate
- type SensorData
- type SensorStatus
- type SensorUpdate
- type Server
- type Tree
- type TreeCluster
- type TreeClusterCreate
- type TreeClusterQuery
- type TreeClusterUpdate
- type TreeCreate
- type TreeQuery
- type TreeSoilCondition
- type TreeUpdate
- type User
- type UserRole
- type UserStatus
- type Vehicle
- type VehicleCreate
- type VehicleEvaluation
- type VehicleQuery
- type VehicleStatus
- type VehicleType
- type VehicleUpdate
- type WateringPlan
- type WateringPlanCreate
- type WateringPlanStatus
- type WateringPlanUpdate
- type WateringStatus
- type Watermark
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthPlugin ¶
type BasicEvent ¶
type BasicEvent struct {
// contains filtered or unexported fields
}
func (BasicEvent) Type ¶
func (e BasicEvent) Type() EventType
type ClientToken ¶
type DrivingLicense ¶
type DrivingLicense string
const ( DrivingLicenseB DrivingLicense = "B" DrivingLicenseBE DrivingLicense = "BE" DrivingLicenseC DrivingLicense = "C" DrivingLicenseCE DrivingLicense = "CE" )
func ParseDrivingLicense ¶
func ParseDrivingLicense(drivingLicense string) DrivingLicense
type Entities ¶
type Entities interface {
Sensor |
Vehicle |
TreeCluster |
Tree |
Region |
WateringPlan |
Evaluation
}
type EntityFunc ¶
type EntityFunc[T Entities] func(*T)
type Evaluation ¶
type Evaluation struct {
TreeCount int64
TreeClusterCount int64
SensorCount int64
WateringPlanCount int64
TotalWaterConsumption int64
UserWateringPlanCount int64
VehicleEvaluation []*VehicleEvaluation
RegionEvaluation []*RegionEvaluation
}
type EvaluationValue ¶
type EventCreateTree ¶
type EventCreateTree struct {
BasicEvent
New *Tree
PrevOfSensor *Tree
}
func NewEventCreateTree ¶
func NewEventCreateTree(newTree, prevOfSensor *Tree) EventCreateTree
type EventDeleteTree ¶
type EventDeleteTree struct {
BasicEvent
Prev *Tree
}
func NewEventDeleteTree ¶
func NewEventDeleteTree(prev *Tree) EventDeleteTree
type EventNewSensorData ¶
type EventNewSensorData struct {
BasicEvent
New *SensorData
}
func NewEventSensorData ¶
func NewEventSensorData(newData *SensorData) EventNewSensorData
type EventType ¶
type EventType string
const ( EventTypeUpdateTree EventType = "update tree" EventTypeCreateTree EventType = "create tree" EventTypeDeleteTree EventType = "delete tree" EventTypeUpdateTreeCluster EventType = "update tree cluster" EventTypeNewSensorData EventType = "receive sensor data" EventTypeUpdateWateringPlan EventType = "update watering plan" )
type EventUpdateTree ¶
type EventUpdateTree struct {
BasicEvent
Prev *Tree
New *Tree
PrevOfSensor *Tree
}
func NewEventUpdateTree ¶
func NewEventUpdateTree(prev, newTree, prevOfSensor *Tree) EventUpdateTree
type EventUpdateTreeCluster ¶
type EventUpdateTreeCluster struct {
BasicEvent
Prev *TreeCluster
New *TreeCluster
}
func NewEventUpdateTreeCluster ¶
func NewEventUpdateTreeCluster(prev, newTc *TreeCluster) EventUpdateTreeCluster
type EventUpdateWateringPlan ¶
type EventUpdateWateringPlan struct {
BasicEvent
Prev *WateringPlan
New *WateringPlan
}
func NewEventUpdateWateringPlan ¶
func NewEventUpdateWateringPlan(prev, newWp *WateringPlan) EventUpdateWateringPlan
type GeoJSON ¶
type GeoJSON struct {
Type GeoJSONType `json:"type"`
Bbox []float64 `json:"bbox"`
Features []GeoJSONFeature `json:"features"`
Metadata GeoJSONMetadata `json:"metadata"`
}
type GeoJSONFeature ¶
type GeoJSONFeature struct {
Type GeoJSONType `json:"type"`
Bbox []float64 `json:"bbox"`
Properties map[string]any `json:"properties"`
Geometry GeoJSONGeometry `json:"geometry"`
}
type GeoJSONGeometry ¶
type GeoJSONGeometry struct {
Type GeoJSONType `json:"type"`
Coordinates [][]float64 `json:"coordinates"`
}
type GeoJSONLocation ¶
type GeoJSONMetadata ¶
type GeoJSONMetadata struct {
StartPoint GeoJSONLocation
EndPoint GeoJSONLocation
WateringPoint GeoJSONLocation
}
type GeoJSONType ¶
type GeoJSONType string
const ( FeatureCollection GeoJSONType = "FeatureCollection" Feature GeoJSONType = "Feature" LineString GeoJSONType = "LineString" )
type IntroSpectTokenResult ¶
type LoginCallback ¶
type LoginRequest ¶
type MqttPayload ¶
type RegionEvaluation ¶
type RegisterUser ¶
type RouteMetadata ¶
type SensorCreate ¶
type SensorCreate struct {
ID string `validate:"required"`
Status SensorStatus `validate:"oneof=online offline unknown"`
LatestData *SensorData
Latitude float64 `validate:"required,max=90,min=-90"`
Longitude float64 `validate:"required,max=180,min=-180"`
Provider string
AdditionalInfo map[string]interface{}
}
type SensorData ¶
type SensorStatus ¶
type SensorStatus string
const ( SensorStatusOnline SensorStatus = "online" SensorStatusOffline SensorStatus = "offline" SensorStatusUnknown SensorStatus = "unknown" )
type SensorUpdate ¶
type SensorUpdate struct {
Status SensorStatus `validate:"oneof=online offline unknown"`
LatestData *SensorData
Latitude float64 `validate:"required,max=90,min=-90"`
Longitude float64 `validate:"required,max=180,min=-180"`
Provider string
AdditionalInfo map[string]interface{}
}
type Tree ¶
type Tree struct {
ID int32
CreatedAt time.Time
UpdatedAt time.Time
TreeCluster *TreeCluster
Sensor *Sensor
PlantingYear int32
Species string
Number string
Latitude float64
Longitude float64
WateringStatus WateringStatus
Description string
LastWatered *time.Time
Provider string
AdditionalInfo map[string]interface{}
}
type TreeCluster ¶
type TreeCluster struct {
ID int32
CreatedAt time.Time
UpdatedAt time.Time
WateringStatus WateringStatus
LastWatered *time.Time
MoistureLevel float64
Region *Region
Address string
Description string
Archived bool
Latitude *float64
Longitude *float64
Trees []*Tree
SoilCondition TreeSoilCondition
Name string
Provider string
AdditionalInfo map[string]interface{}
}
type TreeClusterCreate ¶
type TreeClusterQuery ¶
type TreeClusterQuery struct {
WateringStatuses []WateringStatus `query:"watering_statuses"`
Regions []string `query:"regions"`
Query
}
type TreeClusterUpdate ¶
type TreeCreate ¶
type TreeCreate struct {
TreeClusterID *int32
SensorID *string
PlantingYear int32 `validate:"required"`
Species string
Number string `validate:"required"`
Latitude float64 `validate:"required,max=90,min=-90"`
Longitude float64 `validate:"required,max=180,min=-180"`
Description string
Provider string
AdditionalInfo map[string]interface{}
}
type TreeQuery ¶
type TreeQuery struct {
WateringStatuses []WateringStatus `query:"watering_statuses"`
HasCluster *bool `query:"has_cluster"`
PlantingYears []int32 `query:"planting_years"`
Query
}
type TreeSoilCondition ¶
type TreeSoilCondition string
const ( TreeSoilConditionSchluffig TreeSoilCondition = "schluffig" TreeSoilConditionSandig TreeSoilCondition = "sandig" TreeSoilConditionLehmig TreeSoilCondition = "lehmig" TreeSoilConditionTonig TreeSoilCondition = "tonig" TreeSoilConditionUnknown TreeSoilCondition = "unknown" )
type TreeUpdate ¶
type TreeUpdate struct {
TreeClusterID *int32
SensorID *string
PlantingYear int32 `validate:"gt=0"`
Species string
Number string
Latitude float64 `validate:"omitempty,min=-90,max=90"`
Longitude float64 `validate:"omitempty,min=-180,max=180"`
Description string
Provider string
AdditionalInfo map[string]interface{}
}
type User ¶
type User struct {
ID uuid.UUID
CreatedAt time.Time
Username string `validate:"required,min=3,max=15"`
FirstName string `validate:"required,min=3,max=30"`
LastName string `validate:"required,min=3,max=30"`
Email string `validate:"required,email"`
EmployeeID string
PhoneNumber string
EmailVerified bool
Roles []UserRole
Avatar *url.URL
DrivingLicenses []DrivingLicense
Status UserStatus
}
type UserStatus ¶
type UserStatus string
const ( UserStatusAvailable UserStatus = "available" UserStatusAbsent UserStatus = "absent" UserStatusUnknown UserStatus = "unknown" )
func ParseUserStatus ¶
func ParseUserStatus(status string) UserStatus
type Vehicle ¶
type Vehicle struct {
ID int32
CreatedAt time.Time
UpdatedAt time.Time
ArchivedAt time.Time
NumberPlate string
Description string
WaterCapacity float64
Status VehicleStatus
Type VehicleType
Model string
DrivingLicense DrivingLicense
Height float64
Width float64
Length float64
Weight float64
Provider string
AdditionalInfo map[string]interface{}
}
type VehicleCreate ¶
type VehicleCreate struct {
NumberPlate string `validate:"required"`
Description string
WaterCapacity float64 `validate:"gt=0"`
Status VehicleStatus `validate:"oneof=active available 'not available' unknown"`
Type VehicleType `validate:"oneof=transporter trailer unknown"`
Model string `validate:"required"`
DrivingLicense DrivingLicense `validate:"oneof=B BE C CE"`
Height float64 `validate:"gt=0"`
Width float64 `validate:"gt=0"`
Length float64 `validate:"gt=0"`
Weight float64 `validate:"gt=0"`
Provider string
AdditionalInfo map[string]interface{}
}
type VehicleEvaluation ¶
type VehicleQuery ¶
type VehicleStatus ¶
type VehicleStatus string
const ( VehicleStatusActive VehicleStatus = "active" VehicleStatusAvailable VehicleStatus = "available" VehicleStatusNotAvailable VehicleStatus = "not available" VehicleStatusUnknown VehicleStatus = "unknown" )
type VehicleType ¶
type VehicleType string
const ( VehicleTypeTransporter VehicleType = "transporter" VehicleTypeTrailer VehicleType = "trailer" VehicleTypeUnknown VehicleType = "unknown" )
func ParseVehicleType ¶
func ParseVehicleType(vehicleTypeStr string) VehicleType
type VehicleUpdate ¶
type VehicleUpdate struct {
NumberPlate string `validate:"required"`
Description string
WaterCapacity float64 `validate:"gt=0"`
Status VehicleStatus `validate:"oneof=active available 'not available' unknown"`
Type VehicleType `validate:"oneof=transporter trailer unknown"`
Model string `validate:"required"`
DrivingLicense DrivingLicense `validate:"oneof=B BE C CE"`
Height float64 `validate:"gt=0"`
Width float64 `validate:"gt=0"`
Length float64 `validate:"gt=0"`
Weight float64 `validate:"gt=0"`
Provider string
AdditionalInfo map[string]interface{}
}
type WateringPlan ¶
type WateringPlan struct {
ID int32
CreatedAt time.Time
UpdatedAt time.Time
Date time.Time
Description string
Status WateringPlanStatus
Distance *float64
TotalWaterRequired *float64
UserIDs []*uuid.UUID
TreeClusters []*TreeCluster
Transporter *Vehicle
Trailer *Vehicle
CancellationNote string
Evaluation []*EvaluationValue
GpxURL string
RefillCount int32
Duration time.Duration
Provider string
AdditionalInfo map[string]interface{}
}
type WateringPlanCreate ¶
type WateringPlanCreate struct {
Date time.Time `validate:"required"`
Description string
TreeClusterIDs []*int32 `validate:"required,min=1,dive,required"`
TransporterID *int32 `validate:"required"`
TrailerID *int32
UserIDs []*uuid.UUID `validate:"required,min=1,dive,required"`
Provider string
AdditionalInfo map[string]interface{}
}
type WateringPlanStatus ¶
type WateringPlanStatus string
const ( WateringPlanStatusPlanned WateringPlanStatus = "planned" WateringPlanStatusActive WateringPlanStatus = "active" WateringPlanStatusCanceled WateringPlanStatus = "canceled" WateringPlanStatusFinished WateringPlanStatus = "finished" WateringPlanStatusNotCompeted WateringPlanStatus = "not competed" WateringPlanStatusUnknown WateringPlanStatus = "unknown" )
type WateringPlanUpdate ¶
type WateringPlanUpdate struct {
Date time.Time `validate:"required"`
Description string
TreeClusterIDs []*int32 `validate:"required,min=1,dive,required"`
TransporterID *int32 `validate:"required"`
TrailerID *int32
CancellationNote string
Status WateringPlanStatus `validate:"oneof=planned active canceled finished 'not competed' unknown"`
Evaluation []*EvaluationValue
UserIDs []*uuid.UUID `validate:"required,min=1,dive,required"`
Provider string
AdditionalInfo map[string]interface{}
}
type WateringStatus ¶
type WateringStatus string
const ( WateringStatusGood WateringStatus = "good" WateringStatusModerate WateringStatus = "moderate" WateringStatusBad WateringStatus = "bad" WateringStatusJustWatered WateringStatus = "just watered" WateringStatusUnknown WateringStatus = "unknown" )
Click to show internal directories.
Click to hide internal directories.