util

package
v0.0.0-...-96647dd Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectNetworkConfig

func CollectNetworkConfig() (map[string][]net.IP, error)

func DetectContentType

func DetectContentType(filePath string) (string, error)

func GetEnvVarNames

func GetEnvVarNames() string

func GetFileSystemInfo

func GetFileSystemInfo(path string) (total uint64, free uint64, err error)

GetFileSystemInfo retrieves information about the file system.

func GetMemoryChipInfo

func GetMemoryChipInfo() (string, error)

func GetOSInfo

func GetOSInfo() (map[string]string, error)

GetOSInfo collects OS-specific release info

func GetRunningProcesses

func GetRunningProcesses() ([]string, error)

func HomeDir

func HomeDir() string

func IsExecutable

func IsExecutable(filePath string) bool

func ListCommands

func ListCommands(nameOnly bool) ([]string, error)

ListCommands returns the full path of the first valid executable command encountered in the PATH environment variable. If nameOnly is true, it returns only the command name.

func Uname

func Uname() (string, string)

uname -sm

Types

type CodeBlock

type CodeBlock struct {
	Language string
	Code     string
}

type CpuInfo

type CpuInfo struct {
	CPU       int32
	VendorID  string
	ModelName string
	Cores     int32
	Mhz       float64
	Usage     []float64
}

CpuInfo holds information about a CPU.

func GetCpuInfo

func GetCpuInfo() ([]CpuInfo, error)

GetCpuInfo retrieves and returns information about the CPUs.

type DiskInfo

type DiskInfo struct {
	Device      string
	MountPoint  string
	Filesystem  string
	Total       uint64
	Used        uint64
	Free        uint64
	UsedPercent float64
}

func GetDiskInfo

func GetDiskInfo() ([]DiskInfo, error)

GetDiskInfo retrieves info about the disk usage.

type MarkdownDoc

type MarkdownDoc struct {
	Title      string
	Contents   []string
	CodeBlocks []CodeBlock
}

func ParseMarkdown

func ParseMarkdown(markdownContent string) *MarkdownDoc

type MemoryStats

type MemoryStats struct {
	Total       uint64
	Available   uint64
	Used        uint64
	UsedPercent float64
}

func GetMemoryStats

func GetMemoryStats() (*MemoryStats, error)

GetMemoryStats retrieves info about the memory usage.

type ShellInfo

type ShellInfo struct {
	Name    string
	Path    string
	Version string
}

func GetShellVersion

func GetShellVersion() (*ShellInfo, error)

GetShellVersion determines the current shell and retrieves its version.

type SystemInfo

type SystemInfo struct {
	OS        string
	Arch      string
	OSInfo    map[string]string
	ShellInfo *ShellInfo

	EnvVarNames string
	WorkDir     string
}

func CollectSystemInfo

func CollectSystemInfo() (*SystemInfo, error)

Jump to

Keyboard shortcuts

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