Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bitcav/go-memdev

Golang memory devices information :package:
https://github.com/bitcav/go-memdev

dimm go golang hardware memory ram

Last synced: 17 days ago
JSON representation

Golang memory devices information :package:

Awesome Lists containing this project

README

        


Nitr

![go](https://raw.githubusercontent.com/bitcav/nitr/master/images/goversion.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/bitcav/go-memdev)](https://goreportcard.com/report/github.com/bitcav/go-memdev)
[![GoDoc](https://godoc.org/github.com/narqo/go-badge?status.svg)](https://godoc.org/github.com/bitcav/go-memdev)
[![Build Status](https://travis-ci.org/bitcav/go-memdev.svg?branch=master)](https://travis-ci.org/bitcav/go-memdev)
![preview](https://img.shields.io/badge/platform-linux%20%7C%20%20win-lightgrey)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/bitcav/go-memdev/blob/master/LICENSE)



# go-memdev

A Go package that access to **Memory Devices** information.

## Installation
```
go get -u github.com/bitcav/go-memdev
```

## Usage

```go
package main

import (
"encoding/json"
"fmt"

"github.com/bitcav/go-memdev"
)

func main() {
memInfo, _ := memdev.Info() //the returned value is a struct

jsonOutput, _ := json.MarshalIndent(memInfo, "", " ")

fmt.Println(string(jsonOutput))
}

```

The output is below.

```json
[
{
"bank": "DIMM A",
"size": 4096,
"unit": "MB",
"type": "FBD2",
"formFactor": "SODIMM",
"manufacturer": "Samsung",
"serial": "A49F8D93",
"assetTag": "03153300",
"partNumber": "M471B5173DB0-YK0 ",
"speed": 1600,
"dataWidth": 64,
"totalWidth": 64
}
]

```

## Running

### Build
```
go build
```

### Run
:lock: In order to access the system BIOS requires running with elevated privileges.

* Linux:
```
sudo ./main
```

* Windows:

You can launch the program as an administrator by right-clicking on the executable file and choosing "Run as administrator."