Documentation ¶
Index ¶
- type MockHTTPTestServer
- type MockUnifi
- func (m *MockUnifi) GetAlarms(_ []*unifi.Site) ([]*unifi.Alarm, error)
- func (m *MockUnifi) GetAlarmsSite(_ *unifi.Site) ([]*unifi.Alarm, error)
- func (m *MockUnifi) GetAnomalies(_ []*unifi.Site, _ ...time.Time) ([]*unifi.Anomaly, error)
- func (m *MockUnifi) GetAnomaliesSite(_ *unifi.Site, _ ...time.Time) ([]*unifi.Anomaly, error)
- func (m *MockUnifi) GetClients(_ []*unifi.Site) ([]*unifi.Client, error)
- func (m *MockUnifi) GetClientsDPI(_ []*unifi.Site) ([]*unifi.DPITable, error)
- func (m *MockUnifi) GetDevices(_ []*unifi.Site) (*unifi.Devices, error)
- func (m *MockUnifi) GetEvents(_ []*unifi.Site, _ time.Duration) ([]*unifi.Event, error)
- func (m *MockUnifi) GetIDS(_ []*unifi.Site, _ ...time.Time) ([]*unifi.IDS, error)
- func (m *MockUnifi) GetIDSSite(_ *unifi.Site, _ ...time.Time) ([]*unifi.IDS, error)
- func (m *MockUnifi) GetNetworks(_ []*unifi.Site) ([]unifi.Network, error)
- func (m *MockUnifi) GetRogueAPs(_ []*unifi.Site) ([]*unifi.RogueAP, error)
- func (m *MockUnifi) GetRogueAPsSite(_ *unifi.Site) ([]*unifi.RogueAP, error)
- func (m *MockUnifi) GetServerData() (*unifi.ServerStatus, error)
- func (m *MockUnifi) GetSiteDPI(_ []*unifi.Site) ([]*unifi.DPITable, error)
- func (m *MockUnifi) GetSiteEvents(_ *unifi.Site, _ time.Duration) ([]*unifi.Event, error)
- func (m *MockUnifi) GetSites() ([]*unifi.Site, error)
- func (m *MockUnifi) GetUAPs(_ *unifi.Site) ([]*unifi.UAP, error)
- func (m *MockUnifi) GetUDMs(_ *unifi.Site) ([]*unifi.UDM, error)
- func (m *MockUnifi) GetUSGs(_ *unifi.Site) ([]*unifi.USG, error)
- func (m *MockUnifi) GetUSWs(_ *unifi.Site) ([]*unifi.USW, error)
- func (m *MockUnifi) GetUXGs(_ *unifi.Site) ([]*unifi.UXG, error)
- func (m *MockUnifi) GetUsers(_ []*unifi.Site, _ int) ([]*unifi.User, error)
- func (m *MockUnifi) Login() error
- func (m *MockUnifi) Logout() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockHTTPTestServer ¶
type MockHTTPTestServer struct { Server *httptest.Server // contains filtered or unexported fields }
func NewMockHTTPTestServer ¶
func NewMockHTTPTestServer() *MockHTTPTestServer
func (*MockHTTPTestServer) ServeHTTP ¶
func (m *MockHTTPTestServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MockUnifi ¶
func NewMockUnifi ¶
func NewMockUnifi() *MockUnifi
func (*MockUnifi) GetAlarmsSite ¶
GetAlarmsSite retreives the Alarms for a single Site.
func (*MockUnifi) GetAnomalies ¶
GetAnomalies returns Anomalies for a list of Sites.
func (*MockUnifi) GetAnomaliesSite ¶
GetAnomaliesSite retreives the Anomalies for a single Site.
func (*MockUnifi) GetClients ¶
GetClients returns a response full of clients' data from the UniFi Controller.
func (*MockUnifi) GetClientsDPI ¶
GetClientsDPI garners dpi data for clients.
func (*MockUnifi) GetDevices ¶
GetDevices returns a response full of devices' data from the UniFi Controller.
func (*MockUnifi) GetEvents ¶
GetEvents returns a response full of UniFi Events for the last 1 hour from multiple sites.
func (*MockUnifi) GetIDS ¶
GetIDS returns Intrusion Detection Systems events for a list of Sites. timeRange may have a length of 0, 1 or 2. The first time is Start, the second is End. Events between start and end are returned. End defaults to time.Now().
func (*MockUnifi) GetIDSSite ¶
GetIDSSite retrieves the Intrusion Detection System Data for a single Site. timeRange may have a length of 0, 1 or 2. The first time is Start, the second is End. Events between start and end are returned. End defaults to time.Now().
func (*MockUnifi) GetNetworks ¶
GetNetworks returns a response full of network data from the UniFi Controller.
func (*MockUnifi) GetRogueAPs ¶
GetRogueAPs returns RogueAPs for a list of Sites. Use GetRogueAPsSite if you want more control.
func (*MockUnifi) GetRogueAPsSite ¶
GetRogueAPsSite returns RogueAPs for a single Site.
func (*MockUnifi) GetServerData ¶
func (m *MockUnifi) GetServerData() (*unifi.ServerStatus, error)
GetServerData sets the controller's version and UUID. Only call this if you previously called Login and suspect the controller version has changed.
func (*MockUnifi) GetSiteDPI ¶
GetSiteDPI garners dpi data for sites.
func (*MockUnifi) GetSiteEvents ¶
GetSiteEvents retrieves the last 1 hour's worth of events from a single site.
func (*MockUnifi) GetUAPs ¶
GetUAPs returns all access points, an error, or nil if there are no APs.
func (*MockUnifi) GetUDMs ¶
GetUDMs returns all dream machines, an error, or nil if there are no UDMs.
func (*MockUnifi) GetUSGs ¶
GetUSGs returns all 1Gb gateways, an error, or nil if there are no USGs.
func (*MockUnifi) GetUSWs ¶
GetUSWs returns all switches, an error, or nil if there are no switches.
func (*MockUnifi) GetUXGs ¶
GetUXGs returns all 10Gb gateways, an error, or nil if there are no UXGs.
func (*MockUnifi) GetUsers ¶
GetUsers returns a response full of clients that connected to the UDM within the provided amount of time using the insight historical connection data set.