types API

types

package

API reference for the types package.

T
type

Sign

Sign is a unique signature for the application

pkg/v1/app/types/app.go:18-18
type Sign string
S
struct

AppOptions

AppOptions contains options for creating a new Vanilla OS application

pkg/v1/app/types/app.go:21-43
type AppOptions struct

Fields

Name Type Description
RDNN string
Name string
Version string
LocalesFS fs.FS
DefaultLocale string
CLIOptions *cliTypes.CLIOptions
S
struct

flag

pkg/v1/cli/types/flags.go:11-15
type flag struct

Fields

Name Type Description
Name string
Shorthand string
Usage string
S
struct

BoolFlag

pkg/v1/cli/types/flags.go:17-20
type BoolFlag struct

Fields

Name Type Description
Value bool
S
struct

StringFlag

pkg/v1/cli/types/flags.go:22-25
type StringFlag struct

Fields

Name Type Description
Value string
F
function

NewBoolFlag

Parameters

name
string
shorthand
string
usage
string
value
bool

Returns

pkg/v1/cli/types/flags.go:27-36
func NewBoolFlag(name, shorthand, usage string, value bool) BoolFlag

{
	return BoolFlag{
		flag: flag{
			Name:      name,
			Shorthand: shorthand,
			Usage:     usage,
		},
		Value: value,
	}
}
F
function

NewStringFlag

Parameters

name
string
shorthand
string
usage
string
value
string

Returns

pkg/v1/cli/types/flags.go:38-47
func NewStringFlag(name, shorthand, usage, value string) StringFlag

{
	return StringFlag{
		flag: flag{
			Name:      name,
			Shorthand: shorthand,
			Usage:     usage,
		},
		Value: value,
	}
}
S
struct

CLIOptions

CLIOptions contains options for creating a new command for the CLI.

pkg/v1/cli/types/cli.go:12-21
type CLIOptions struct

Fields

Name Type Description
Use string
Short string
Long string
S
struct

ConfigOptions

ConfigOptions is a struct that holds the configuration options

pkg/v1/conf/types/conf.go:12-25
type ConfigOptions struct

Fields

Name Type Description
Domain string
Path string
Type string
Prefix string
S
struct

Permission

Permission represents file permissions of a file

pkg/v1/fs/types/permission.go:14-26
type Permission struct

Methods

String
Method

Returns

string
func (Permission) String() string
{
	boolToChar := func(b bool) string {
		if b {
			return "r"
		}
		return "-"
	}
	return fmt.Sprintf("%s%s%s%s%s%s%s%s%s",
		boolToChar(p.OwnerRead), boolToChar(p.OwnerWrite), boolToChar(p.OwnerExecute),
		boolToChar(p.GroupRead), boolToChar(p.GroupWrite), boolToChar(p.GroupExecute),
		boolToChar(p.OthersRead), boolToChar(p.OthersWrite), boolToChar(p.OthersExecute),
	)
}

Fields

Name Type Description
OwnerRead bool
OwnerWrite bool
OwnerExecute bool
GroupRead bool
GroupWrite bool
GroupExecute bool
OthersRead bool
OthersWrite bool
OthersExecute bool
S
struct

BaseInfo

BaseInfo contains the common fields for both disks and partitions

pkg/v1/fs/types/disk.go:12-21
type BaseInfo struct

Fields

Name Type Description
Path string
Size int64
HumanSize string
Filesystem string
Mountpoint string
Label string
UUID string
PARTUUID string
S
struct

PartitionInfo

PartitionInfo represents information about a disk partition

pkg/v1/fs/types/disk.go:24-26
type PartitionInfo struct
S
struct

DiskInfo

DiskInfo represents information about a disk

pkg/v1/fs/types/disk.go:29-32
type DiskInfo struct

Fields

Name Type Description
Partitions []PartitionInfo
S
struct

FileInfo

FileInfo represents information about a file

pkg/v1/fs/types/file.go:12-30
type FileInfo struct

Fields

Name Type Description
Path string
ParentPath string
IsDirectory bool
Size int64
Permissions Permission
Extension string
S
struct

FileDiffInfo

FileDiff represents the difference between two files.

pkg/v1/fs/types/file.go:33-40
type FileDiffInfo struct

Fields

Name Type Description
AddedLines []string
RemovedLines []string
T
type

PCIDeviceMap

PCIDeviceMap represents a map of PCIDeviceMapVendor structs

pkg/v1/hardware/types/pci.go:12-12
type PCIDeviceMap []PCIDeviceMapVendor
S
struct

PCIDeviceMapDevice

PCIDeviceMapDevice represents a PCI (Peripheral Component Interconnect)
device

pkg/v1/hardware/types/pci.go:16-19
type PCIDeviceMapDevice struct

Fields

Name Type Description
ID string
Name string
S
struct

PCIDeviceMapVendor

PCIDeviceMapVendor represents a PCI (Peripheral Component Interconnect)
vendor

pkg/v1/hardware/types/pci.go:23-27
type PCIDeviceMapVendor struct

Fields

Name Type Description
ID string
Name string
Devices []PCIDeviceMapDevice
S
struct

PCIDevice

PCIDevice represents a PCI (Peripheral Component Interconnect) device

pkg/v1/hardware/types/pci.go:30-57
type PCIDevice struct

Fields

Name Type Description
ID string json:"id"
Class string json:"class"
Name string json:"name"
VendorName string json:"vendor_name"
Vendor string json:"vendor"
Device string json:"device"
SubsystemDevice string json:"subsystem_device"
SubsystemVendor string json:"subsystem_vendor"
Modalias string json:"modalias"
S
struct

Peripheral

Peripheral represents a system peripheral.

pkg/v1/hardware/types/peripheral.go:12-16
type Peripheral struct

Fields

Name Type Description
ID string json:"id"
Name string json:"name"
Type DeviceType json:"type"
S
struct

BatteryStats

BatteryStats represents battery statistics

pkg/v1/hardware/types/battery.go:12-18
type BatteryStats struct

Fields

Name Type Description
Capacity int json:"capacity"
CapacityDesign int json:"capacityDesign"
Percentage int json:"percentage"
Status BatteryStatus json:"status"
Voltage int json:"voltage"
T
type

BatteryStatus

BatteryStatus represents the status of a battery

pkg/v1/hardware/types/battery.go:21-21
type BatteryStatus string
T
type

DeviceType

DeviceType represents a system device type

pkg/v1/hardware/types/device_type.go:12-12
type DeviceType string
S
struct

InputDevice

InputDevice represents an input device

pkg/v1/hardware/types/input_device.go:12-15
type InputDevice struct

Fields

Name Type Description
Name string json:"name"
Product string json:"product"
T
type

ChassisType

ChassisType represents the standardized chassis type.

pkg/v1/hardware/types/machine.go:12-12
type ChassisType string
S
struct

MachineInfo

MachineInfo contains various information about the current machine

pkg/v1/hardware/types/machine.go:54-61
type MachineInfo struct

Fields

Name Type Description
ProductName string json:"productName"
Manufacturer string json:"manufacturer"
Version string json:"version"
Chassis ChassisInfo json:"chassis"
Bios BiosInfo json:"bios"
Board BoardInfo json:"board"
S
struct

ChassisInfo

ChassisInfo contains various information about the machine chassis

pkg/v1/hardware/types/machine.go:64-69
type ChassisInfo struct

Fields

Name Type Description
ID int json:"id"
Type ChassisType json:"type"
Manufacturer string json:"manufacturer"
Version string json:"version"
S
struct

BiosInfo

BiosInfo contains various information about the machine bios

pkg/v1/hardware/types/machine.go:72-76
type BiosInfo struct

Fields

Name Type Description
Vendor string json:"vendor"
Version string json:"version"
Release string json:"release"
S
struct

BoardInfo

BoardInfo contains various information about the machine board

pkg/v1/hardware/types/machine.go:79-83
type BoardInfo struct

Fields

Name Type Description
ProductName string json:"product"
Manufacturer string json:"manufacturer"
Version string json:"version"
T
type

DeviceType

DeviceType represents the type of media device (e.g., audio input/output).

pkg/v1/media/types/device.go:12-12
type DeviceType string
S
struct

MediaDevice

MediaDevice represents a system media device, typically parsed from wpctl.

pkg/v1/media/types/device.go:21-36
type MediaDevice struct

Fields

Name Type Description
ID string json:"id"
Name string json:"name"
Description string json:"description"
Type DeviceType json:"type"
IsDefault bool json:"is_default"
S
struct

VolumeInfo

VolumeInfo represents volume information, typically for the default sink/source.

pkg/v1/media/types/volume.go:12-18
type VolumeInfo struct

Fields

Name Type Description
LevelPercent int json:"level_percent"
IsMuted bool json:"is_muted"
S
struct

DNSInfo

DNSInfo represents DNS (Domain Name System) information

pkg/v1/net/types/dns_info.go:12-15
type DNSInfo struct

Fields

Name Type Description
Hostname string json:"hostname"
IPAddresses []string json:"ip_addresses"
S
struct

NetworkInterfaceInfo

NetworkInterfaceInfo represents information about a network interface

pkg/v1/net/types/network_interface_info.go:12-44
type NetworkInterfaceInfo struct

Fields

Name Type Description
Name string json:"name"
HardwareAddr string json:"hardware_address"
IPAddresses []string json:"ip_addresses"
Status NetworkInterfaceStatus json:"status"
Running bool json:"running"
SupportsBroadcast bool json:"supports_broadcast"
SupportsMulticast bool json:"supports_multicast"
IsLoopback bool json:"is_loopback"
IsP2P bool json:"is_point_to_point"
T
type

NetworkInterfaceStatus

NetworkInterfaceStatus represents the status of a network interface

pkg/v1/net/types/network_interface_info.go:47-47
type NetworkInterfaceStatus string
T
type

PortStatus

PortStatus represents the status of a network port

pkg/v1/net/types/port_status.go:12-12
type PortStatus string
S
struct

ConnectionInfo

ConnectionInfo represents information about an connection

pkg/v1/net/types/connection.go:12-21
type ConnectionInfo struct

Fields

Name Type Description
LocalAddr string json:"local_address"
RemoteAddr string json:"remote_address"
State ConnState json:"state"
T
type

ConnState

ConnState represents the status of a connection

pkg/v1/net/types/connection.go:24-24
type ConnState string
S
struct

Notification

Notification represents a desktop notification.

pkg/v1/notification/types/notification.go:12-19
type Notification struct

Fields

Name Type Description
AppName string
Title string
Message string
Icon string
Timeout int32
Action NotificationAction
S
struct

NotificationAction

NotificationAction represents a desktop notification button.

pkg/v1/notification/types/notification.go:22-25
type NotificationAction struct

Fields

Name Type Description
Label string
Callback func()
F
function

NewNotification

NewNotification creates a new Notification instance.

Parameters

appName
string
title
string
message
string
icon
string
timeout
int32
action
...NotificationAction

Returns

pkg/v1/notification/types/notification.go:28-43
func NewNotification(appName, title, message, icon string, timeout int32, action ...NotificationAction) *Notification

{
	var notificationAction NotificationAction

	if len(action) > 0 {
		notificationAction = action[0]
	}

	return &Notification{
		AppName: appName,
		Title:   title,
		Message: message,
		Icon:    icon,
		Timeout: timeout,
		Action:  notificationAction,
	}
}
F
function

NewNotificationAction

NewNotificationAction creates a new NotificationAction instance.

Parameters

label
string
callback
func()
pkg/v1/notification/types/notification.go:46-51
func NewNotificationAction(label string, callback func()) NotificationAction

{
	return NotificationAction{
		Label:    label,
		Callback: callback,
	}
}
S
struct

Document

Document represents a roff document buffer.

pkg/v1/roff/types/roff.go:14-16
type Document struct

Fields

Name Type Description
Buffer bytes.Buffer
S
struct

Process

Process represents information about a process

pkg/v1/system/types/process.go:12-39
type Process struct

Fields

Name Type Description
PID int json:"pid"
Name string json:"name"
State string json:"state"
PPID int json:"ppid"
Priority int json:"priority"
Nice int json:"nice"
Threads int json:"threads"
UID int json:"uid"
GID int json:"gid"
S
struct

SystemInfo

SystemInfo is a struct that contains information about the system

pkg/v1/system/types/system_info.go:12-28
type SystemInfo struct

Fields

Name Type Description
OS string
Version string
Codename string
Arch string
MachineType MachineType
S
struct

Timezone

Timezone represents a supported timezone

pkg/v1/system/types/timezone.go:12-18
type Timezone struct

Fields

Name Type Description
Name string json:"name"
Location string json:"location"
S
struct

UserInfo

UserInfo represents information about a user

pkg/v1/system/types/user_info.go:12-30
type UserInfo struct

Fields

Name Type Description
UID string json:"uid"
GID string json:"gid"
Username string json:"username"
Name string json:"name"
HomeDir string json:"home_directory"
Shell string json:"shell"
S
struct

GroupInfo

GroupInfo represents information about a group

pkg/v1/system/types/group_info.go:12-18
type GroupInfo struct

Fields

Name Type Description
GID string json:"gid"
Name string json:"name"
T
type

MachineType

MachineType is the representation of the type of machine

pkg/v1/system/types/machine_type.go:12-12
type MachineType string
S
struct

OSReleaseInfo

OSReleaseInfo is a struct that contains information about the OS release

pkg/v1/system/types/os_release_info.go:12-21
type OSReleaseInfo struct

Fields

Name Type Description
Name string
Version string
Codename string