mirror of
https://github.com/sigmasternchen/iot-relay
synced 2025-03-15 06:28:55 +00:00
22 lines
292 B
Go
22 lines
292 B
Go
package types
|
|
|
|
type Request struct {
|
|
ID string
|
|
Location string
|
|
IP string
|
|
Data map[string]string
|
|
}
|
|
|
|
func (r Request) IsValid() bool {
|
|
if len(r.IP) == 0 {
|
|
return false
|
|
}
|
|
if len(r.ID) == 0 {
|
|
return false
|
|
}
|
|
if len(r.Location) == 0 {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|