memory

package
v0.0.0-...-4316413 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 7 Imported by: 13

Documentation

Overview

Package memory regroups collecting information about the memory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// TotalBytes is the total memory for the host in byte
	TotalBytes uint64
	// SwapTotalBytes is the swap memory size in byte (Unix only)
	SwapTotalBytes uint64
}

Memory holds memory metadata about the host

func Get

func Get() (*Memory, []string, error)

Get returns a Memory struct already initialized, a list of warnings and an error. The method will try to collect as much metadata as possible, an error is returned if nothing could be collected. The list of warnings contains errors if some metadata could not be collected.

func (*Memory) Collect

func (memory *Memory) Collect() (result interface{}, err error)

Collect collects the Memory information. Returns an object which can be converted to a JSON or an error if nothing could be collected. Tries to collect as much information as possible.

func (*Memory) Name

func (memory *Memory) Name() string

Name returns the name of the package

Jump to

Keyboard shortcuts

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