device

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device represents a device and its properties

func NewDevice

func NewDevice(nodeID, internalIP string, bandwidthUp, bandwidthDown int64, storage Storage) *Device

NewDevice creates a new Device instance with the specified properties.

func (*Device) GetBandwidthDown

func (device *Device) GetBandwidthDown() int64

GetBandwidthDown returns the bandwidth download limit for the device.

func (*Device) GetBandwidthUp

func (device *Device) GetBandwidthUp() int64

GetBandwidthUp returns the bandwidth upload limit for the device.

func (*Device) GetInternalIP

func (device *Device) GetInternalIP() string

GetInternalIP returns the internal IP address for the device.

func (*Device) GetNodeID

func (device *Device) GetNodeID(ctx context.Context) (string, error)

GetNodeID returns the ID of the device.

func (*Device) GetNodeInfo

func (device *Device) GetNodeInfo(ctx context.Context) (types.NodeInfo, error)

GetNodeInfo returns information about the device as a NodeInfo struct.

func (*Device) SetBandwidthUp

func (device *Device) SetBandwidthUp(bandwidthUp int64)

SetBandwidthUp sets the bandwidth upload limit for the device.

type Storage

type Storage interface {
	GetDiskUsageStat() (totalSpace, usage float64)
	GetFileSystemType() string
}

Storage represents a storage system and its properties.

Jump to

Keyboard shortcuts

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