entities

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Version   string
	GoVersion string
	BuildTime time.Time
	Git       Git
	Server    Server
}

type ClientToken

type ClientToken struct {
	AccessToken      string
	IDToken          string
	ExpiresIn        int
	RefreshExpiresIn int
	RefreshToken     string
	TokenType        string
	NotBeforePolicy  int
	SessionState     string
	Scope            string
}

type Entities

type Entities interface {
	Sensor |
		Flowerbed |
		Image |
		Vehicle |
		TreeCluster |
		Tree |
		Region
}

type EntityFunc

type EntityFunc[T Entities] func(*T)

type Flowerbed

type Flowerbed struct {
	ID             int32
	CreatedAt      time.Time
	UpdatedAt      time.Time
	Size           float64
	Description    string
	NumberOfPlants int32
	MoistureLevel  float64
	Region         *Region
	Address        string
	Sensor         *Sensor
	Images         []*Image
	Archived       bool
	Latitude       float64
	Longitude      float64
}

type Git

type Git struct {
	Branch     string
	Commit     string
	Repository *url.URL
}

type Image

type Image struct {
	ID        int32
	CreatedAt time.Time
	UpdatedAt time.Time
	URL       string
	Filename  *string
	MimeType  *string
}

type IntroSpectTokenResult

type IntroSpectTokenResult struct {
	Exp      *int
	Active   *bool
	AuthTime *int
	Type     *string
}

type LoginCallback

type LoginCallback struct {
	Code        string `validate:"required"`
	RedirectURL *url.URL
}

type LoginRequest

type LoginRequest struct {
	RedirectURL *url.URL
}

type LoginResp

type LoginResp struct {
	LoginURL *url.URL
}

type Logout

type Logout struct {
	RefreshToken string `validate:"required"`
}

type MqttData

type MqttData struct {
	Name           string
	Time           *time.Time
	Identifiers    []MqttIdentifier
	Data           MqttDataPayload
	CorrelationIDs []string
	Origin         string
	Context        map[string]string
	Visibility     MqttVisibility
	UniqueID       string
}

type MqttDataPayload

type MqttDataPayload struct {
	Type           string
	EndDeviceIDs   MqttIdentifierDeviceID
	CorrelationIDs []string
	ReceivedAt     *time.Time
	UplinkMessage  MqttUplinkMessage
}

type MqttDecodedPayload

type MqttDecodedPayload struct {
	Battery  float64
	Humidity int
	Raw      int
}

type MqttIdentifier

type MqttIdentifier struct {
	DeviceIDs MqttIdentifierDeviceID
}

type MqttIdentifierApplicationID

type MqttIdentifierApplicationID struct {
	ApplicationID string
}

type MqttIdentifierDeviceID

type MqttIdentifierDeviceID struct {
	DeviceID       string
	ApplicationIDs MqttIdentifierApplicationID
	DevEUI         string
	JoinEUI        string
	DevAddr        string
}

type MqttLocation

type MqttLocation struct {
	Latitude  float64
	Longitude float64
	Altitude  float64
}

type MqttNetworkIDs

type MqttNetworkIDs struct {
	NetID          string
	NSID           string
	TenantID       string
	ClusterID      string
	ClusterAddress string
	TenantAddress  string
}

type MqttPayload

type MqttPayload struct {
	EndDeviceIDs   MqttIdentifierDeviceID
	CorrelationIDs []string
	ReceivedAt     *time.Time
	UplinkMessage  MqttUplinkMessage
}

func (*MqttPayload) GetBattery

func (m *MqttPayload) GetBattery() float64

func (*MqttPayload) GetHumidity

func (m *MqttPayload) GetHumidity() int

type MqttRxMetadata

type MqttRxMetadata struct {
	GatewayIDs      MqttRxMetadataGatewayIDs
	PacketBroker    MqttRxMetadataPacketBroker
	Time            *time.Time
	Rssi            int
	ChannelRssi     int
	Snr             float64
	FrequencyOffset string
	Location        MqttLocation
	UplinkToken     string
	ReceivedAt      *time.Time
}

type MqttRxMetadataGatewayIDs

type MqttRxMetadataGatewayIDs struct {
	GatewayID string
}

type MqttRxMetadataPacketBroker

type MqttRxMetadataPacketBroker struct {
	MessageID            string
	ForwarderNetID       string
	ForwarderTenantID    string
	ForwarderClusterID   string
	ForwarderGatewayID   string
	ForwarderGatewayEUI  string
	HomeNetworkNetID     string
	HomeNetworkTenantID  string
	HomeNetworkClusterID string
}

type MqttUplinkMessage

type MqttUplinkMessage struct {
	SessionKeyID    string
	FPort           int
	Fcnt            int
	FRMPayload      string
	DecodedPayload  MqttDecodedPayload
	RxMetadata      []MqttRxMetadata
	Settings        MqttUplinkSettings
	ReceivedAt      *time.Time
	Confirmed       bool
	ConsumedAirtime string
	VersionIDs      MqttVersionIDs
	NetworkIDs      MqttNetworkIDs
}

type MqttUplinkSettings

type MqttUplinkSettings struct {
	DataRate  MqttUplinkSettingsDataRate
	Frequency string
}

type MqttUplinkSettingsDataRate

type MqttUplinkSettingsDataRate struct {
	Lora MqttUplinkSettingsLora
}

type MqttUplinkSettingsLora

type MqttUplinkSettingsLora struct {
	Bandwidth       int
	SpreadingFactor int
	CodingRate      string
}

type MqttVersionIDs

type MqttVersionIDs struct {
	BrandID         string
	ModelID         string
	HardwareVersion string
	FirmwareVersion string
	BandID          string
}

type MqttVisibility

type MqttVisibility struct {
	Rights []string
}

type Region

type Region struct {
	ID        int32
	CreatedAt time.Time
	UpdatedAt time.Time
	Name      string
}

type RegisterUser

type RegisterUser struct {
	User     User
	Password string `validate:"required"`
	Roles    *[]string
}

type Role

type Role struct {
	Name string
}

type Sensor

type Sensor struct {
	ID        int32
	CreatedAt time.Time
	UpdatedAt time.Time
	Status    SensorStatus
	Data      []*SensorData
}

type SensorData

type SensorData struct {
	ID        int32
	CreatedAt time.Time
	UpdatedAt time.Time
	Data      *MqttPayload
}

type SensorStatus

type SensorStatus string
const (
	SensorStatusOnline  SensorStatus = "online"
	SensorStatusOffline SensorStatus = "offline"
	SensorStatusUnknown SensorStatus = "unknown"
)

type Server

type Server struct {
	OS        string
	Arch      string
	Hostname  string
	URL       *url.URL
	IP        net.IP
	Port      int
	Interface string
	Uptime    time.Duration
}

type Tree

type Tree struct {
	ID             int32
	CreatedAt      time.Time
	UpdatedAt      time.Time
	TreeCluster    *TreeCluster
	Sensor         *Sensor
	Images         []*Image
	Readonly       bool
	PlantingYear   int32
	Species        string
	Number         string
	Latitude       float64
	Longitude      float64
	WateringStatus WateringStatus
	Description    string
}

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
}

type TreeClusterCreate

type TreeClusterCreate struct {
	Address       string
	Description   string
	Name          string
	SoilCondition TreeSoilCondition
	TreeIDs       []*int32
}

type TreeClusterUpdate

type TreeClusterUpdate struct {
	Address       string
	Description   string
	SoilCondition TreeSoilCondition
	TreeIDs       []*int32
	Name          string
}

type TreeCreate

type TreeCreate struct {
	TreeClusterID *int32
	SensorID      *int32
	Readonly      bool
	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
}

type TreeImport

type TreeImport struct {
	Area         string `validate:"required"`
	Number       string `validate:"required"`
	Species      string
	Latitude     float64 `validate:"required,max=90,min=-90"`
	Longitude    float64 `validate:"required,max=180,min=-180"`
	PlantingYear int32   `validate:"gt=0"`
	Street       string  `validate:"required"`
	TreeID       int32
}

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      *int32
	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
}

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
	Avatar        *url.URL
}

type Vehicle

type Vehicle struct {
	ID            int32
	CreatedAt     time.Time
	UpdatedAt     time.Time
	NumberPlate   string
	Description   string
	WaterCapacity float64
}

type WateringStatus

type WateringStatus string
const (
	WateringStatusGood     WateringStatus = "good"
	WateringStatusModerate WateringStatus = "moderate"
	WateringStatusBad      WateringStatus = "bad"
	WateringStatusUnknown  WateringStatus = "unknown"
)

Jump to

Keyboard shortcuts

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