gonet

package module
v0.0.0-...-1d10200 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 12 Imported by: 0

README

GONET

drawing

GitHub go.mod Go version of a Go module

Go Reference

A simple go network tool that prints information about your system, cpu information, memory usage, disk usage, network interfaces & MAC address.

This tool is built on top of GO PSUTIL.

Table printing is done using this nifty library called GO PRETTYTABLE.

Screenshot showing usage of gonet

Installation (binary)


git clone https://github.com/abiiranathan/gonet.git

cd gonet
go build -ldflags "-w -s" cmd/gonet.go

./gonet
API Usage

go get github.com/abiiranathan/gonet
Dump metrics to stdout
package main

import (
	"os"

	"github.com/abiiranathan/gonet"
)


func main() {
	gonet.WriteMetrics(os.Stdout)

  // Replace os.Stdout with any io.Writer interface
}
Raw metrics
metrics := gonet.ReadMetrics()
fmt.Printf("Mem Total: %d", metrics.TotalMemory)

Documentation

Overview

gonet is a simple go network tool that prints information about your system, cpu information, memory usage, disk usage, network interfaces & MAC address.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMetrics

func ReadMetrics() sysMetrics

ReadMetrics reads metrics from the system and returns a Metrics struct

func WriteMetrics

func WriteMetrics(writer io.Writer)

WriteMetrics writes metrics to the given writer. If writer is nil, it will write to stdout

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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