2018-06-03 20:37:52 +02:00
|
|
|
package database
|
|
|
|
|
2018-07-16 13:00:37 +02:00
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"github.com/FreifunkBremen/yanic/lib/jsontime"
|
|
|
|
)
|
2018-07-10 21:40:38 +02:00
|
|
|
|
2018-06-03 20:37:52 +02:00
|
|
|
type AP struct {
|
2018-07-16 13:00:37 +02:00
|
|
|
IP *net.IP `json:"ip"`
|
|
|
|
Lastseen jsontime.Time `json:"lastseen"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (db *DB) GetClients(ap *AP) []*Client {
|
|
|
|
var clients []*Client
|
|
|
|
for _, client := range db.Clients {
|
|
|
|
if client.AP == ap {
|
|
|
|
clients = append(clients, client)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return clients
|
2018-06-03 20:37:52 +02:00
|
|
|
}
|