models

package
v0.0.0-...-68594da Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	DeploymentDate time.Time  `diff:"deploymentdate"`
	LastUpdate     *time.Time `diff:"lastupdate"`
	State          string     `diff:"state"`
	Version        string     `diff:"version"`
}

type App

type App struct {
	Applications []ApplicationGroup `diff:"applications"`
}

type AppUpdate

type AppUpdate struct {
	BasicUpdate
	App
}

type Application

type Application struct {
	Name           string             `diff:"name"`
	AppManager     ApplicationManager `diff:"manager"`
	Status         ApplicationStatus  `diff:"status"`
	Ports          []ApplicationPort  `diff:"ports"`
	CpuLimits      int                `diff:"cpuLimits"`
	MemoryLimits   uint64             `diff:"memoryLimits"`
	AdditionalInfo interface{}        `diff:"info"`
}

type ApplicationGroup

type ApplicationGroup struct {
	Name           string        `diff:"name"`
	Applications   []Application `diff:"applications"`
	AdditionalInfo interface{}   `diff:"info"`
}

type ApplicationManager

type ApplicationManager string
const (
	ManagerUnknown    ApplicationManager = "unknown"
	ManagerSystemd    ApplicationManager = "systemd"
	ManagerDocker     ApplicationManager = "docker"
	ManagerPodman     ApplicationManager = "podman"
	ManagerKubernetes ApplicationManager = "kubernetes"
)

type ApplicationPort

type ApplicationPort struct {
	Port              int               `diff:"port"`
	TransportProtocol TransportProtocol `diff:"transport"`
	InterfaceAddress  string            `diff:"interface"`
}

type ApplicationStatus

type ApplicationStatus string
const (
	StatusUnknown ApplicationStatus = "unknown"
	StatusRunning ApplicationStatus = "running"
	StatusStopped ApplicationStatus = "stopped"
	StatusFailed  ApplicationStatus = "failed"
)

type BasicUpdate

type BasicUpdate struct {
	Uuid string
}

type CounterResponse

type CounterResponse struct {
	Value uint64 `json:"value"`
}

CounterResponse is the response for the counter API.

type Cpu

type Cpu struct {
}

type CpuUpdate

type CpuUpdate struct {
	BasicUpdate
	Cpu
}

type Device

type Device struct {
	Name            string `diff:"name"`
	HostId          string `diff:"hostid"`
	Arch            string `diff:"arch"`
	KernelVersion   string `diff:"kernel"`
	Platform        string `diff:"platform"`
	PlatformFamily  string `diff:"platformfamily"`
	PlatformVersion string `diff:"platformversion"`
	OS              string `diff:"os"`
	Product         string `diff:"product"`
	Boottime        uint64 `diff:"-"`
	Uptime          uint64 `diff:"-"`
}

type DeviceUpdate

type DeviceUpdate struct {
	BasicUpdate
	Device
}

type Disk

type Disk struct {
	Disks []StorageItem
}

type DiskType

type DiskType string
const (
	DiskHDD   DiskType = "hdd"
	DiskSSD   DiskType = "ssd"
	DiskFlash DiskType = "flash"
	DiskOther DiskType = "other"
)

type DiskUpdate

type DiskUpdate struct {
	BasicUpdate
	Disk
}

type DockerGroupInfo

type DockerGroupInfo struct {
	IsCompose   bool   `diff:"isCompose"`
	ComposeFile string `diff:"composeFile"`
	WorkingDir  string `diff:"workinDir"`
}

type DockerInfo

type DockerInfo struct {
	ContainerId   string
	ContainerName string `diff:"containerName"`
}

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ErrorResponse is the http error response.

type FileSystemType

type FileSystemType string
const (
	FsExt4  FileSystemType = "ext4"
	FsBtrfs FileSystemType = "btrfs"
	FsFat   FileSystemType = "fat"
	FsvFat  FileSystemType = "vfat"
	FsNtfs  FileSystemType = "ntfs"
	FsSwap  FileSystemType = "swap"
	FsNone  FileSystemType = "none"
	FsOther FileSystemType = "other"
)

type Host

type Host struct {
	Uuid    string   `diff:"uuid"`
	Agent   Agent    `diff:"agent"`
	Device  *Device  `diff:"device"`
	Network *Network `diff:"network"`
	Cpu     *Cpu     `diff:"cpu"`
	Ram     *Ram     `diff:"ram"`
	Disk    *Disk    `diff:"disk"`
	App     *App     `diff:"app"`
}

type IPAddress

type IPAddress struct {
	Address net.IP
	MaskLen uint8
}

type Interface

type Interface struct {
	Name         string
	Virtual      bool
	Mac          string
	IPv4         []IPAddress
	IPv6         []IPAddress
	Mtu          int
	State        InterfaceState
	Type         InterfaceType
	Speed        string
	Capabilities []NicCapability
}

type InterfaceState

type InterfaceState string
const (
	StateDisabled     InterfaceState = "disabled"
	StateDisconnected InterfaceState = "disconnected"
	StateConnected    InterfaceState = "connected"
	StateUnknown      InterfaceState = "unknown"
)

type InterfaceType

type InterfaceType string
const (
	TypeEthernet  InterfaceType = "ethernet"
	TypeVirtual   InterfaceType = "virtual"
	TypeWireless  InterfaceType = "wireless"
	TypeBluetooth InterfaceType = "bluetooth"
	TypeLoopback  InterfaceType = "loopback"
	TypeBridge    InterfaceType = "bridge"
	TypeTunnel    InterfaceType = "tunnel"
	TypeUnknown   InterfaceType = "unknown"
)

type Network

type Network struct {
	Interfaces []*Interface
}

type NetworkUpdate

type NetworkUpdate struct {
	BasicUpdate
	Network
}

type NicCapability

type NicCapability struct {
	Name      string `json:"name"`
	IsEnabled bool   `json:"is_enabled"`
	CanEnable bool   `json:"can_enable"`
}

type OkResponse

type OkResponse struct {
	Status string
	Ok     bool
}

type PartitionType

type PartitionType string
const (
	PartitionGpt PartitionType = "gpt"
	PartitionDos PartitionType = "dos"
)

type Ram

type Ram struct {
	TotalSystemBytes uint64
	Slots            []RamSlot
}

type RamSlot

type RamSlot struct {
	Index    uint8
	SlotName string
	Content  *RamSlotContent
}

type RamSlotContent

type RamSlotContent struct {
	Description string
	Product     string
	Vendor      string
	SizeInBytes uint64
	Width       uint8
	ClockHertz  uint64
}

type RamUpdate

type RamUpdate struct {
	BasicUpdate
	Ram
}

type StorageItem

type StorageItem struct {
	Manufacturer  string
	Product       string
	DiskType      DiskType
	LogicalName   string
	Serial        string
	SizeBytes     uint64
	PartitionType PartitionType
	Partitions    []StoragePartition
}

type StoragePartition

type StoragePartition struct {
	FileSystemType FileSystemType
	LogicalName    string
	Position       int
	SizeBytes      uint64
	FsTotalBytes   uint64 `json:"total"`
	FsFreeBytes    uint64 `json:"free"`
	FsUsedBytes    uint64 `json:"used"`
}

type TransportProtocol

type TransportProtocol string
const (
	TransportTcp TransportProtocol = "tcp"
	TransportUdp TransportProtocol = "udp"
)

Jump to

Keyboard shortcuts

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