Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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:
- Host: GitHub
- URL: https://github.com/bitcav/go-memdev
- Owner: bitcav
- License: mit
- Created: 2020-08-08T01:46:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T01:18:50.000Z (over 4 years ago)
- Last Synced: 2024-06-19T02:09:38.284Z (7 months ago)
- Topics: dimm, go, golang, hardware, memory, ram
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 15
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![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-memdevA Go package that access to **Memory Devices** information.
## Installation
```
go get -u github.com/bitcav/go-memdev
```## Usage
```go
package mainimport (
"encoding/json"
"fmt""github.com/bitcav/go-memdev"
)func main() {
memInfo, _ := memdev.Info() //the returned value is a structjsonOutput, _ := 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."