entity

package
v0.0.0-...-b14b7d6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 5 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	ID          uint   `gorm:"primaryKey"`
	IP          string `gorm:"uniqueIndex:idx_device"`
	Community   string `gorm:"uniqueIndex:idx_device"`
	SysName     string
	SysLocation string
	IsAlive     bool
	Template    Template `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	TemplateID  uint
	LastCheck   time.Time
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type DeviceWithOID

type DeviceWithOID struct {
	ID          uint
	IP          string
	SysName     string
	SysLocation string
	Community   string
	IsAlive     bool
	Template    Template
	TemplateID  uint
	OidBw       string
	OidIn       string
	OidOut      string
	LastCheck   time.Time
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Fat

type Fat struct {
	ID         uint `gorm:"primaryKey"`
	LocationID uint
	Splitter   uint8
	Latitude   float64 `gorm:"uniqueIndex:idx_unique_fat_location"`
	Longitude  float64 `gorm:"uniqueIndex:idx_unique_fat_location"`
	Address    string  `gorm:"uniqueIndex:idx_unique_fat_location"`
	Fat        string
	ODN        string
	Location   Location `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type FatInterface

type FatInterface struct {
	ID          uint      `gorm:"primaryKey"`
	FatID       uint      `gorm:"uniqueIndex:idx_unique_fat_interface"`
	InterfaceID uint      `gorm:"uniqueIndex:idx_unique_fat_interface"`
	Fat         Fat       `gorm:"constraint:OnDelete:SET NULL"`
	Interface   Interface `gorm:"constraint:OnDelete:CASCADE"`
}

type FatResponse

type FatResponse struct {
	ID             uint
	FatInterfaceID uint
	InterfaceID    uint
	DeviceID       uint
	LocationID     uint
	Splitter       uint8
	Latitude       float64
	Longitude      float64
	Address        string
	Fat            string
	ODN            string
	FatInterface   FatInterface
	Location       Location
	Interface      Interface
	Device         Device
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type Interface

type Interface struct {
	ID        uint `gorm:"primaryKey"`
	IfIndex   uint `gorm:"uniqueIndex:idx_interface"`
	IfName    string
	IfDescr   string
	IfAlias   string
	Device    Device `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	DeviceID  uint   `gorm:"uniqueIndex:idx_interface"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Location

type Location struct {
	ID           uint   `gorm:"primaryKey"`
	State        string `gorm:"uniqueIndex:idx_unique_location"`
	County       string `gorm:"uniqueIndex:idx_unique_location"`
	Municipality string `gorm:"uniqueIndex:idx_unique_location"`
}

type Measurement

type Measurement struct {
	Interface   Interface `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	InterfaceID uint      `gorm:"uniqueIndex"`
	Date        time.Time
	Bandwidth   uint
	In          uint
	Out         uint
}

type Report

type Report struct {
	ID               uuid.UUID `gorm:"type:uuid;primary_key;"`
	Category         string
	OriginalFilename string
	ContentType      string
	Filepath         string
	User             User `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	UserID           uint
	CreatedAt        time.Time
	UpdatedAt        time.Time
	DeletedAt        gorm.DeletedAt
}

func (*Report) BeforeCreate

func (rp *Report) BeforeCreate(tx *gorm.DB) (err error)

type Template

type Template struct {
	ID        uint   `gorm:"primaryKey"`
	Name      string `gorm:"uniqueIndex"`
	OidBw     string `gorm:"default:1.3.6.1.2.1.2.2.1.5"`
	OidIn     string `gorm:"default:1.3.6.1.2.1.31.1.1.1.6"`
	OidOut    string `gorm:"default:1.3.6.1.2.1.31.1.1.1.10"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Traffic

type Traffic struct {
	Interface   Interface `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	InterfaceID uint
	Date        time.Time
	Bandwidth   uint
	In          uint
	Out         uint
}

type User

type User struct {
	ID             uint `gorm:"primaryKey"`
	Fullname       string
	Email          string
	Password       string
	ChangePassword bool
	IsAdmin        bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeleteAt       gorm.DeletedAt
}

type UserResponse

type UserResponse struct {
	Fullname string
	P00      uint
	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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