Versions in this module Expand all Collapse all v0 v0.0.8 Oct 17, 2020 Changes in this version + const APIAnomaliesPath + const APIClientDPI + const APIClientPath + const APIDevicePath + const APIEventPath + const APIEventPathAlarms + const APIEventPathIDS + const APILoginPath + const APILoginPathNew + const APINetworkPath + const APIPrefixNew + const APISiteDPI + const APISiteList + const APIStatusPath + var DPIApps = DPIMap + var DPICats = DPIMap + type Alarm struct + AppProto string + Archived FlexBool + Catname string + Datetime time.Time + DestIP string + DestIPGeo IPGeo + DestPort int + DstIPASN string + DstIPCountry string + DstMAC string + EventType string + FlowID int64 + HandledAdminID string + HandledTime time.Time + Host string + ID string + InIface string + InnerAlertAction string + InnerAlertCategory string + InnerAlertGID int64 + InnerAlertRev int64 + InnerAlertSeverity int64 + InnerAlertSignature string + InnerAlertSignatureID int64 + Key string + Msg string + Proto string + SiteID string + SiteName string + SourceIPGeo IPGeo + SourceName string + SrcIP string + SrcIPASN string + SrcIPCountry string + SrcMAC string + SrcPort int + Subsystem string + Time int64 + Timestamp int64 + TxID FlexInt + USGIP string + USGIPASN string + USGIPCountry string + USGIPGeo IPGeo + UniqueAlertID string + type Anomaly struct + Anomaly string + Datetime time.Time + DeviceMAC string + SiteName string + SourceName string + type Ap struct + Ap string + Bytes FlexInt + Datetime time.Time + Duration FlexInt + GuestMacFilterRejections FlexInt + GuestRxBytes FlexInt + GuestRxCrypts FlexInt + GuestRxDropped FlexInt + GuestRxErrors FlexInt + GuestRxFrags FlexInt + GuestRxPackets FlexInt + GuestTxBytes FlexInt + GuestTxDropped FlexInt + GuestTxErrors FlexInt + GuestTxPackets FlexInt + GuestTxRetries FlexInt + GuestWifiTxAttempts FlexInt + GuestWifiTxDropped FlexInt + MacFilterRejections FlexInt + O string + Oid string + RxBytes FlexInt + RxCrypts FlexInt + RxDropped FlexInt + RxErrors FlexInt + RxFrags FlexInt + RxPackets FlexInt + SiteID string + Time FlexInt + TxBytes FlexInt + TxDropped FlexInt + TxErrors FlexInt + TxPackets FlexInt + TxRetries FlexInt + UserMacFilterRejections FlexInt + UserRxBytes FlexInt + UserRxCrypts FlexInt + UserRxDropped FlexInt + UserRxErrors FlexInt + UserRxFrags FlexInt + UserRxPackets FlexInt + UserTxBytes FlexInt + UserTxDropped FlexInt + UserTxErrors FlexInt + UserTxPackets FlexInt + UserTxRetries FlexInt + UserWifiTxAttempts FlexInt + UserWifiTxDropped FlexInt + WifiTxAttempts FlexInt + WifiTxDropped FlexInt + type Client struct + Anomalies int64 + ApMac string + ApName string + AssocTime int64 + Blocked bool + Bssid string + BytesR int64 + Ccq int64 + Channel FlexInt + DevCat FlexInt + DevFamily FlexInt + DevID FlexInt + DevVendor FlexInt + DhcpendTime FlexInt + Essid string + FirstSeen int64 + FixedIP string + GwMac string + GwName string + Hostname string + ID string + IP string + IdleTime int64 + Is11R FlexBool + IsGuest FlexBool + IsGuestByUAP FlexBool + IsGuestByUGW FlexBool + IsGuestByUSW FlexBool + IsWired FlexBool + LastSeen int64 + LastSeenByUAP int64 + LastSeenByUGW int64 + LastSeenByUSW int64 + LatestAssocTime int64 + Mac string + Name string + Network string + NetworkID string + Noise int64 + Note string + Noted FlexBool + OsClass FlexInt + OsName FlexInt + Oui string + PowersaveEnabled FlexBool + QosPolicyApplied FlexBool + Radio string + RadioDescription string + RadioName string + RadioProto string + RoamCount int64 + Rssi int64 + RxBytes int64 + RxBytesR int64 + RxPackets int64 + RxRate int64 + Satisfaction FlexInt + Signal int64 + SiteID string + SiteName string + SourceName string + SwDepth int + SwMac string + SwName string + SwPort FlexInt + TxBytes int64 + TxBytesR int64 + TxPackets int64 + TxPower int64 + TxRate int64 + TxRetries int64 + Uptime int64 + UptimeByUAP int64 + UptimeByUGW int64 + UptimeByUSW int64 + UseFixedIP FlexBool + UserGroupID string + UserID string + Vlan FlexInt + WifiTxAttempts int64 + WiredRxBytes int64 + WiredRxBytesR int64 + WiredRxPackets int64 + WiredTxBytes int64 + WiredTxBytesR int64 + WiredTxPackets int64 + type Config struct + DebugLog Logger + ErrorLog Logger + New bool + Pass string + URL string + User string + VerifySSL bool + type DPIData struct + App int + Cat int + RxBytes int64 + RxPackets int64 + TxBytes int64 + TxPackets int64 + type DPIMap map[int]string + func (d DPIMap) Get(cat int) string + func (d DPIMap) GetApp(cat, app int) string + func (d DPIMap) Keys() []string + type DPITable struct + ByApp []DPIData + ByCat []DPIData + LastUpdated int64 + MAC string + Name string + SiteName string + SourceName string + type Devices struct + UAPs []*UAP + UDMs []*UDM + USGs []*USG + USWs []*USW + type Event struct + Admin string + Ap string + ApFrom string + ApName string + ApTo string + AppProto string + Bytes FlexInt + Catname string + Channel FlexInt + ChannelFrom FlexInt + ChannelTo FlexInt + Datetime time.Time + DestIP string + DestIPGeo IPGeo + DestPort int + DstMAC string + Duration FlexInt + EventType string + FlowID FlexInt + Guest string + Gw string + GwName string + Host string + Hostname string + ID string + IP string + InIface string + InnerAlertAction string + InnerAlertCategory string + InnerAlertGID FlexInt + InnerAlertRev FlexInt + InnerAlertSeverity FlexInt + InnerAlertSignature string + InnerAlertSignatureID FlexInt + IsAdmin FlexBool + Key string + Msg string + Network string + Proto string + Radio string + RadioFrom string + RadioTo string + SSID string + SiteID string + SiteName string + SourceIPGeo IPGeo + SourceName string + SrcIP string + SrcIPASN string + SrcIPCountry string + SrcMAC string + SrcPort int + Subsystem string + Sw string + SwName string + Time int64 + Timestamp int64 + USGIP string + USGIPASN string + USGIPCountry string + USGIPGeo IPGeo + UniqueAlertID string + User string + type FlexBool struct + Txt string + Val bool + func (f *FlexBool) String() string + func (f *FlexBool) UnmarshalJSON(b []byte) error + type FlexInt struct + Txt string + Val float64 + func (f *FlexInt) String() string + func (f *FlexInt) UnmarshalJSON(b []byte) error + type Gw struct + Datetime time.Time + Duration FlexInt + Gw string + LanRxBytes FlexInt + LanRxDropped FlexInt + LanRxPackets FlexInt + LanTxBytes FlexInt + LanTxPackets FlexInt + O string + Oid string + SiteID string + Time FlexInt + WanRxBytes FlexInt + WanRxDropped FlexInt + WanRxErrors FlexInt + WanRxPackets FlexInt + WanTxBytes FlexInt + WanTxPackets FlexInt + type IDS struct + AppProto string + Archived FlexBool + Catname string + Datetime time.Time + DestIP string + DestIPGeo IPGeo + DestPort int + DstIPASN string + DstIPCountry string + DstMAC string + EventType string + FlowID int64 + Host string + ID string + InIface string + InnerAlertAction string + InnerAlertCategory string + InnerAlertGID int64 + InnerAlertRev int64 + InnerAlertSeverity int64 + InnerAlertSignature string + InnerAlertSignatureID int64 + Key string + Msg string + Proto string + SiteID string + SiteName string + SourceIPGeo IPGeo + SourceName string + SrcIP string + SrcIPASN string + SrcIPCountry string + SrcMAC string + SrcPort int + Subsystem string + Time int64 + Timestamp int64 + USGIP string + USGIPASN string + USGIPCountry string + USGIPGeo IPGeo + UniqueAlertID string + type IPGeo struct + Asn int64 + City string + ContinentCode string + CountryCode string + CountryName string + Latitude float64 + Longitude float64 + Organization string + func (v *IPGeo) UnmarshalJSON(data []byte) error + type Logger func(msg string, fmt ...interface{}) + type Network struct + DhcpGuardEnabled FlexBool + DhcpRelayEnabled FlexBool + DhcpdDNSEnabled FlexBool + DhcpdEnabled FlexBool + DhcpdGatewayEnabled FlexBool + DhcpdIP1 string + DhcpdLeasetime FlexInt + DhcpdTimeOffsetEnabled FlexBool + DomainName string + Enabled FlexBool + ID string + IPSubnet string + IsNat FlexBool + Name string + Networkgroup string + Purpose string + SiteID string + Vlan FlexInt + VlanEnabled FlexBool + type NetworkTable []struct + type Port struct + AggregatedBy FlexBool + Autoneg FlexBool + BytesR FlexInt + DNS []string + Dot1XMode string + Dot1XStatus string + Enable FlexBool + FlowctrlRx FlexBool + FlowctrlTx FlexBool + FullDuplex FlexBool + IP string + Ifname string + IsUplink FlexBool + Jumbo FlexBool + Mac string + Masked FlexBool + Media string + Name string + NetworkName string + NumPort int + OpMode string + PoeCaps FlexInt + PoeClass string + PoeCurrent FlexInt + PoeEnable FlexBool + PoeGood FlexBool + PoeMode string + PoePower FlexInt + PoeVoltage FlexInt + PortDelta struct{ ... } + PortIdx FlexInt + PortPoe FlexBool + PortconfID string + RxBroadcast FlexInt + RxBytes FlexInt + RxBytesR FlexInt + RxDropped FlexInt + RxErrors FlexInt + RxMulticast FlexInt + RxPackets FlexInt + Satisfaction FlexInt + SfpFound FlexBool + Speed FlexInt + SpeedCaps FlexInt + StpPathcost FlexInt + StpState string + TxBroadcast FlexInt + TxBytes FlexInt + TxBytesR FlexInt + TxDropped FlexInt + TxErrors FlexInt + TxMulticast FlexInt + TxPackets FlexInt + Type string + Up FlexBool + type RadioTable []struct + type RadioTableStats []struct + type Site struct + AttrHiddenID string + AttrNoDelete FlexBool + Desc string + Health []struct{ ... } + ID string + Name string + NumNewAlarms FlexInt + SiteName string + SourceName string + type SpeedtestStatus struct + Latency FlexInt + Rundate FlexInt + Runtime FlexInt + ServerDesc string + StatusDownload FlexInt + StatusPing FlexInt + StatusSummary FlexInt + StatusUpload FlexInt + XputDownload FlexInt + XputUpload FlexInt + type Sw struct + Bytes FlexInt + Datetime time.Time + Duration FlexInt + O string + Oid string + RxBroadcast FlexInt + RxBytes FlexInt + RxCrypts FlexInt + RxDropped FlexInt + RxErrors FlexInt + RxFrags FlexInt + RxMulticast FlexInt + RxPackets FlexInt + SiteID string + Sw string + Time FlexInt + TxBroadcast FlexInt + TxBytes FlexInt + TxDropped FlexInt + TxErrors FlexInt + TxMulticast FlexInt + TxPackets FlexInt + TxRetries FlexInt + type SysStats struct + Loadavg1 FlexInt + Loadavg15 FlexInt + Loadavg5 FlexInt + MemBuffer FlexInt + MemTotal FlexInt + MemUsed FlexInt + type SystemStats struct + CPU FlexInt + Mem FlexInt + Uptime FlexInt + type Temperature struct + Name string + Type string + Value float64 + type UAP struct + AdoptableWhenUpgraded FlexBool + Adopted FlexBool + AntennaTable []struct{ ... } + BandsteeringMode string + BoardRev int + Bytes FlexInt + BytesD FlexInt + BytesR FlexInt + Cfgversion string + ConfigNetwork struct{ ... } + ConnectRequestIP string + ConnectRequestPort string + CountrycodeTable []int + DeviceID string + DownlinkTable []struct{ ... } + EthernetTable []struct{ ... } + FwCaps int + GuestNumSta FlexInt + GuestToken string + HasEth1 FlexBool + HasFan FlexBool + HasSpeaker FlexBool + HasTemperature FlexBool + HwCaps int + ID string + IP string + InformIP string + InformURL string + Isolated FlexBool + KnownCfgversion string + LastSeen FlexInt + LastUplink struct{ ... } + LedOverride string + Locating FlexBool + Mac string + MeshStaVapEnabled FlexBool + Meshv3PeerMac string + Model string + Name string + NumSta FlexInt + OutdoorModeOverride string + PortTable []Port + RadioTable RadioTable + RadioTableStats RadioTableStats + RequiredVersion string + Rollupgrade FlexBool + RxBytes FlexInt + RxBytesD FlexInt + SSHSessionTable []interface{} + Satisfaction FlexInt + ScanRadioTable []interface{} + Scanning FlexBool + Serial string + SiteID string + SiteName string + SourceName string + SpectrumScanning FlexBool + Stat UAPStat + State FlexInt + SysErrorCaps int + SysStats SysStats + SystemStats SystemStats + TwoPhaseAdopt FlexBool + TxBytes FlexInt + TxBytesD FlexInt + Type string + UUptime FlexInt + Unsupported FlexBool + UnsupportedReason FlexInt + Upgradable FlexBool + Uplink struct{ ... } + UplinkTable []interface{} + Uptime FlexInt + UserNumSta FlexInt + VapTable VapTable + Version string + VwireEnabled FlexBool + VwireTable []interface{} + VwireVapTable []interface{} + WifiCaps int + WlangroupIDNa string + WlangroupIDNg string + type UAPStat struct + func (v *UAPStat) UnmarshalJSON(data []byte) error + type UDM struct + AdoptIP string + AdoptManual FlexBool + AdoptState FlexInt + AdoptStatus FlexInt + AdoptTries FlexInt + AdoptURL string + AdoptableWhenUpgraded FlexBool + Adopted FlexBool + BandsteeringMode string + BoardRev FlexInt + Bytes FlexInt + BytesD FlexInt + BytesR FlexInt + Cfgversion string + ConfigNetwork struct{ ... } + ConnectRequestIP string + ConnectRequestPort string + Default FlexBool + DeviceID string + DiscoveredVia string + Dot1XPortctrlEnabled FlexBool + DownlinkTable []interface{} + EthernetOverrides []struct{ ... } + EthernetTable []struct{ ... } + FlowctrlEnabled FlexBool + FwCaps FlexInt + GuestLanNumSta FlexInt + GuestNumSta FlexInt + GuestToken string + GuestWlanNumSta FlexInt + HasEth1 FlexBool + HasFan FlexBool + HasSpeaker FlexBool + HwCaps FlexInt + ID string + IP string + InformIP string + InformURL string + JumboframeEnabled FlexBool + KnownCfgversion string + LanNumSta FlexInt + LastSeen FlexInt + LicenseState string + Locating FlexBool + Mac string + Model string + Name string + NetworkTable NetworkTable + NumDesktop FlexInt + NumHandheld FlexInt + NumMobile FlexInt + NumSta FlexInt + Overheating FlexBool + PortOverrides []struct{ ... } + PortTable []Port + PowerSourceCtrlEnabled FlexBool + RadioTable *RadioTable + RadioTableStats *RadioTableStats + RequiredVersion string + RulesetInterfaces interface{} + RxBytes FlexInt + RxBytesD FlexInt + Serial string + SiteID string + SiteName string + SourceName string + SpeedtestStatus SpeedtestStatus + SpeedtestStatusSaved FlexBool + Stat UDMStat + State FlexInt + StpPriority FlexInt + StpVersion string + SwitchCaps struct{ ... } + SysStats SysStats + SystemStats SystemStats + Temperatures []Temperature + TxBytes FlexInt + TxBytesD FlexInt + Type string + Unsupported FlexBool + UnsupportedReason FlexInt + UpgradeState FlexInt + Uplink Uplink + Uptime FlexInt + UserLanNumSta FlexInt + UserNumSta FlexInt + UserWlanNumSta FlexInt + UsgCaps FlexInt + VapTable *VapTable + Version string + VwireTable []interface{} + Wan1 Wan + Wan2 Wan + WifiCaps FlexInt + WlanNumSta FlexInt + WlangroupIDNa string + WlangroupIDNg string + XInformAuthkey string + type UDMStat struct + type USG struct + AdoptableWhenUpgraded FlexBool + Adopted FlexBool + BoardRev FlexInt + Bytes FlexInt + Cfgversion string + ConfigNetwork struct{ ... } + ConnectRequestIP string + ConnectRequestPort string + DeviceID string + EthernetOverrides []struct{ ... } + EthernetTable []struct{ ... } + FwCaps FlexInt + GuestNumSta FlexInt + GuestToken string + HwCaps FlexInt + ID string + IP string + InformIP string + InformURL string + KnownCfgversion string + LastSeen FlexInt + LedOverride string + LicenseState string + Locating FlexBool + Mac string + Model string + Name string + NetworkTable NetworkTable + NumDesktop FlexInt + NumHandheld FlexInt + NumMobile FlexInt + NumSta FlexInt + OutdoorModeOverride string + PortTable []struct{ ... } + RequiredVersion string + Rollupgrade FlexBool + RxBytes FlexInt + Serial string + SiteID string + SiteName string + SourceName string + SpeedtestStatus SpeedtestStatus + SpeedtestStatusSaved FlexBool + Stat USGStat + State FlexInt + SysStats SysStats + SystemStats SystemStats + TxBytes FlexInt + Type string + Unsupported FlexBool + UnsupportedReason FlexInt + Upgradable FlexBool + Uplink Uplink + Uptime FlexInt + UserNumSta FlexInt + UsgCaps FlexInt + Version string + Wan1 Wan + Wan2 Wan + type USGStat struct + func (v *USGStat) UnmarshalJSON(data []byte) error + type USW struct + AdoptableWhenUpgraded FlexBool + Adopted FlexBool + BoardRev FlexInt + Bytes FlexInt + Cfgversion string + ConfigNetwork struct{ ... } + ConnectRequestIP string + ConnectRequestPort string + DeviceID string + Dot1XPortctrlEnabled FlexBool + DownlinkTable []struct{ ... } + EthernetTable []struct{ ... } + FanLevel FlexInt + FlowctrlEnabled FlexBool + FwCaps FlexInt + GeneralTemperature FlexInt + GuestNumSta FlexInt + HasFan FlexBool + HasTemperature FlexBool + HwCaps FlexInt + ID string + IP string + InformIP string + InformURL string + JumboframeEnabled FlexBool + KnownCfgversion string + LastSeen FlexInt + LastUplink struct{ ... } + LedOverride string + LicenseState string + Locating FlexBool + Mac string + Model string + Name string + NumSta FlexInt + OutdoorModeOverride string + Overheating FlexBool + PortOverrides []struct{ ... } + PortTable []Port + RequiredVersion string + Rollupgrade FlexBool + RxBytes FlexInt + Serial string + SiteID string + SiteName string + SourceName string + Stat USWStat + State FlexInt + StpPriority FlexInt + StpVersion string + SwitchCaps struct{ ... } + SysErrorCaps FlexInt + SysStats SysStats + SystemStats SystemStats + TotalMaxPower FlexInt + TxBytes FlexInt + Type string + Unsupported FlexBool + UnsupportedReason FlexInt + Upgradable FlexBool + Uplink Uplink + UplinkDepth FlexInt + Uptime FlexInt + UserNumSta FlexInt + Version string + type USWStat struct + func (v *USWStat) UnmarshalJSON(data []byte) error + type Unifi struct + func NewUnifi(config *Config) (*Unifi, error) + func (u *Unifi) GetAlarms(sites []*Site) ([]*Alarm, error) + func (u *Unifi) GetAlarmsSite(site *Site) ([]*Alarm, error) + func (u *Unifi) GetAnomalies(sites []*Site, timeRange ...time.Time) ([]*Anomaly, error) + func (u *Unifi) GetAnomaliesSite(site *Site, timeRange ...time.Time) ([]*Anomaly, error) + func (u *Unifi) GetClients(sites []*Site) ([]*Client, error) + func (u *Unifi) GetClientsDPI(sites []*Site) ([]*DPITable, error) + func (u *Unifi) GetData(apiPath string, v interface{}, params ...string) error + func (u *Unifi) GetDevices(sites []*Site) (*Devices, error) + func (u *Unifi) GetEvents(sites []*Site, hours time.Duration) ([]*Event, error) + func (u *Unifi) GetIDS(sites []*Site, timeRange ...time.Time) ([]*IDS, error) + func (u *Unifi) GetIDSSite(site *Site, timeRange ...time.Time) ([]*IDS, error) + func (u *Unifi) GetJSON(apiPath string, params ...string) ([]byte, error) + func (u *Unifi) GetNetworks(sites []*Site) ([]Network, error) + func (u *Unifi) GetServerData() error + func (u *Unifi) GetSiteDPI(sites []*Site) ([]*DPITable, error) + func (u *Unifi) GetSiteEvents(site *Site, hours time.Duration) ([]*Event, error) + func (u *Unifi) GetSites() ([]*Site, error) + func (u *Unifi) Login() error + func (u *Unifi) UniReq(apiPath string, params string) (req *http.Request, err error) + type Uplink struct + BytesR FlexInt + Drops FlexInt + Enable FlexBool + FullDuplex FlexBool + Gateways []string + IP string + Latency FlexInt + Mac string + MaxSpeed FlexInt + Name string + Nameservers []string + Netmask string + NumPort FlexInt + RxBytes FlexInt + RxBytesR FlexInt + RxDropped FlexInt + RxErrors FlexInt + RxMulticast FlexInt + RxPackets FlexInt + Speed FlexInt + SpeedtestLastrun FlexInt + SpeedtestPing FlexInt + SpeedtestStatus string + TxBytes FlexInt + TxBytesR FlexInt + TxDropped FlexInt + TxErrors FlexInt + TxPackets FlexInt + Type string + Up FlexBool + Uptime FlexInt + XputDown FlexInt + XputUp FlexInt + type VapTable []struct + type Wan struct + Autoneg FlexBool + BytesR FlexInt + DNS []string + Enable FlexBool + FlowctrlRx FlexBool + FlowctrlTx FlexBool + FullDuplex FlexBool + Gateway string + IP string + Ifname string + IsUplink FlexBool + Mac string + MaxSpeed FlexInt + Media string + Name string + Netmask string + NumPort int + PortIdx int + PortPoe FlexBool + RxBroadcast FlexInt + RxBytes FlexInt + RxBytesR FlexInt + RxDropped FlexInt + RxErrors FlexInt + RxMulticast FlexInt + RxPackets FlexInt + Speed FlexInt + TxBroadcast FlexInt + TxBytes FlexInt + TxBytesR FlexInt + TxDropped FlexInt + TxErrors FlexInt + TxMulticast FlexInt + TxPackets FlexInt + Type string + Up FlexBool