models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID    uint64 `gorm:"primaryKey;autoIncrement"`
	Name  string
	Email string
}

type ClientSubscription

type ClientSubscription struct {
	ID uint64 `gorm:"primaryKey;autoIncrement"`

	ClientID uint64 //FK to Client.id
	Client   Client `gorm:"foreignKey:ClientID"`

	TaskTypeID uint64     //FK to TaskType.id
	TaskType   LvTaskType `gorm:"foreignKey:TaskTypeID"`

	TestsCountSubscribed int
	TestsCountExecuted   int

	// the tasks should be assined on each X period
	Period time.Duration

	LastExecutionCompleted time.Time

	Opts []byte `gorm:"type:jsonb"`

	IsActive bool
}

type LvProtocol

type LvProtocol struct {
	ID   int64
	Type string
}

type LvTaskStatus

type LvTaskStatus struct {
	ID     uint8 `gorm:"primaryKey;autoIncrement"`
	Status string
}

type LvTaskType

type LvTaskType struct {
	ID   uint64 `gorm:"primaryKey;autoIncrement"`
	Type string
}

type Sensor

type Sensor struct {
	ID       uuid.UUID `gorm:"primaryKey;autoIncrement"`
	Name     string
	Location string
	Secret   string
}

type SensorRank

type SensorRank struct {
	ID uint64 `gorm:"primaryKey;autoIncrement"`

	SensorID uuid.UUID //FK to Client.id
	Sensor   Sensor    `gorm:"foreignKey:SensorID"`

	CurrentRank int8

	CreatedAt time.Time
}

type Task

type Task struct {
	ID                   uuid.UUID          `gorm:"type:uuid;primary_key;" json:"id"`
	TaskTypeID           uint64             //FK to TaskType.id
	TaskType             LvTaskType         `gorm:"foreignKey:TaskTypeID"`
	TaskStatusID         uint8              //FK to TaskType.id
	TaskStatus           LvTaskStatus       `gorm:"foreignKey:TaskStatusID"`
	SensorID             uuid.UUID          //FK to Sensor.id
	Sensor               Sensor             `gorm:"foreignKey:SensorID"`
	ClientSubscriptionID uint64             //FK to ClientSubscription.id
	ClientSubscription   ClientSubscription `gorm:"foreignKey:ClientSubscriptionID"`
	Opts                 []byte             `gorm:"type:jsonb"`
}

type TsDnsResult

type TsDnsResult struct {
	TsSensorTaskBase
	QueryRtt    int64
	SocketRtt   int64
	RespSize    int64
	Proto       int64
	IPAddresses []net.IP `gorm:"type:inet[]"`
}

type TsHostRuntimeStat

type TsHostRuntimeStat struct {
	TsSensorTaskBase
	GoRoutineCount int
	//
	CpuCores     uint16
	CpuUsage     float64
	CpuModelName string
	//
	MemTotal       uint64
	MemUsed        uint64
	MemFree        uint64
	MemUsedPercent float64
	//
	Network string
}

type TsHttpResult

type TsHttpResult struct {
	TsSensorTaskBase
	ResponseCode     uint8
	DNSLookup        time.Duration
	TCPConnection    time.Duration
	TLSHandshake     time.Duration
	ServerProcessing time.Duration
	NameLookup       time.Duration
	Connect          time.Duration
	Pretransfer      time.Duration
	StartTransfer    time.Duration
	//
	ResponseBody    string
	ResponseHeaders []byte `gorm:"type:jsonb"`
}

type TsIcmpResult

type TsIcmpResult struct {
	TsSensorTaskBase
	IPAddr          net.IP `gorm:"type:inet"`
	PacketsSent     int
	PacketsReceived int
	BytesWritten    int
	BytesRead       int
	TotalRTT        time.Duration
	MinRTT          time.Duration
	MaxRTT          time.Duration
	AverageRTT      time.Duration
	Loss            float64
	FailureMessages string
}

type TsSensorTaskBase

type TsSensorTaskBase struct {
	Time     time.Time `gorm:"type:TIMESTAMPTZ;"`
	SensorID uuid.UUID `gorm:"type:uuid;"`
	TaskID   uuid.UUID `gorm:"type:uuid;"`
}

Jump to

Keyboard shortcuts

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