models

package
v0.0.0-...-8cac4cc Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

type Count struct {
	StartTime           string `xml:"StartTime,attr"`
	StartTimeLocal      time.Time
	StartTimeUTC        time.Time
	EndTime             string `xml:"EndTime,attr"`
	EndTimeLocal        time.Time
	EndTimeUTC          time.Time
	UnixStartTime       int64 `xml:"UnixStartTime,attr"`
	UnixStartTimeParsed time.Time
	Enters              int `xml:"Enters,attr"`
	Exits               int `xml:"Exits,attr"`
	Status              int `xml:"Status,attr"`
}

type Counter

type Counter struct {
	ID string `gorm:"primaryKey"`

	SiteID   string
	Site     *Site
	DeviceID string
	Device   *Device

	StartTime time.Time
	EndTime   time.Time
	Enters    int
	Exits     int
	Status    int

	gorm.Model
}

type Device

type Device struct {
	ID string `gorm:"primaryKey"`

	Name         string
	MacAddress   string
	IPAddress    string
	HostName     string
	HTTPPort     int
	HTTPSPort    int
	Timezone     int
	TimezoneName string
	DST          int
	HwPlatform   string
	SerialNumber string
	DeviceType   int
	SwRelease    string
	LastTransmit time.Time

	SiteID string
	Site   *Site

	gorm.Model
}

type MetricsV5

type MetricsV5 struct {
	XMLName    xml.Name   `xml:"Metrics"`
	SiteID     string     `xml:"SiteId,attr"`
	SiteName   string     `xml:"Sitename,attr"`
	DeviceID   string     `xml:"DeviceId,attr"`
	DeviceName string     `xml:"Devicename,attr"`
	DivisionID string     `xml:"DivisionId,attr"`
	Properties Properties `xml:"Properties"`
	ReportData ReportData `xml:"ReportData"`
}

func (*MetricsV5) Process

func (m *MetricsV5) Process()

type Object

type Object struct {
	ID         string  `xml:"Id,attr"`
	DeviceID   string  `xml:"DeviceId,attr"`
	DeviceName string  `xml:"Devicename,attr"`
	ObjectType string  `xml:"ObjectType,attr"`
	Name       string  `xml:"Name,attr"`
	ExternalID string  `xml:"ExternalId,attr"`
	Counts     []Count `xml:"Count"`
}

type Properties

type Properties struct {
	Version         int   `xml:"Version"`
	TransmitTime    int64 `xml:"TransmitTime"`
	TransmitTimeUTC time.Time
	MacAddress      string `xml:"MacAddress"`
	IPAddress       string `xml:"IpAddress"`
	HostName        string `xml:"HostName"`
	HTTPPort        int    `xml:"HttpPort"`
	HTTPSPort       int    `xml:"HttpsPort"`
	Timezone        int    `xml:"Timezone"`
	TimezoneName    string `xml:"TimezoneName"`
	DST             int    `xml:"DST"`
	TimezoneParsed  *time.Location
	HwPlatform      string `xml:"HwPlatform"`
	SerialNumber    string `xml:"SerialNumber"`
	DeviceType      int    `xml:"DeviceType"`
	SwRelease       string `xml:"SwRelease"`
}

func (*Properties) UnmarshalXML

func (p *Properties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Report

type Report struct {
	Date      string    `xml:"Date,attr"`
	DateLocal time.Time `xml:"-"`
	DateUTC   time.Time `xml:"-"`
	Objects   []Object  `xml:"Object"`
}

type ReportData

type ReportData struct {
	Interval int      `xml:"Interval,attr"`
	Reports  []Report `xml:"Report"`
}

type Site

type Site struct {
	ID string `gorm:"primaryKey"`

	SiteID     string
	SiteName   string
	DivisionID string

	gorm.Model
}

type TotalCount

type TotalCount struct {
	ID string `gorm:"primaryKey"`

	DeviceID string
	Device   *Device

	Exits  int
	Enters int

	gorm.Model
}

Jump to

Keyboard shortcuts

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