platform

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* Copyright (C) 2020-2021 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootTime

func BootTime() (bootime time.Time, err error)

Gets system uptime.

func Hostname

func Hostname() (string, error)

Gets hostname.

func IsWindows

func IsWindows() bool

Checks whether we are running on Windows or not.

func LineSeparator

func LineSeparator() string

Returns the line separator.

func NodeName

func NodeName() (nodename string, err error)

Gets system node name (equivalent to uname -n).

func PlatformInformation

func PlatformInformation() (information string, err error)

Gets platform information (equivalent to uname -s).

func SystemInformation

func SystemInformation() (information string, err error)

Gets system information (equivalent to uname -a)

func Uname

func Uname() (string, error)

func UnixLineSeparator added in v1.1.0

func UnixLineSeparator() string

Returns the line separator on Unix platform.

func UpTime

func UpTime() (uptime time.Duration, err error)

Gets system uptime.

Types

type RAM

type RAM interface {
	// Gets total amount of RAM on this system
	GetTotal() uint64
	//Gets RAM available for programs to allocate
	GetAvailable() uint64
	// Gets RAM used by programs
	GetUsed() uint64
	// Gets Percentage of RAM used by programs
	GetUsedPercent() float64
	// Gets kernel's notion of free memory
	GetFree() uint64
}

func GetRAM

func GetRAM() (ram RAM, err error)

type VirtualMemory

type VirtualMemory struct {
	Total       uint64
	Available   uint64
	Used        uint64
	UsedPercent float64
	Free        uint64
}

func (*VirtualMemory) GetAvailable

func (m *VirtualMemory) GetAvailable() uint64

func (*VirtualMemory) GetFree

func (m *VirtualMemory) GetFree() uint64

func (*VirtualMemory) GetTotal

func (m *VirtualMemory) GetTotal() uint64

func (*VirtualMemory) GetUsed

func (m *VirtualMemory) GetUsed() uint64

func (*VirtualMemory) GetUsedPercent

func (m *VirtualMemory) GetUsedPercent() float64

Jump to

Keyboard shortcuts

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