Giter Site home page Giter Site logo

osinfo's Introduction

osinfo

Go Reference Go Report Card

What is osinfo?

OSinfo is a cross-platform OS Version collection tool. It is designed to unify multiple OS detection methods in a single module that can easily be integrated into other projects.

Offically Supported

Windows Based:

  • Windows Server 2016
  • Windows Server 2019
  • Windows 7
  • Windows 10

Debian Linux Based:

  • Ubuntu
  • Debian
  • Kali Rolling
  • Parrot OS

Red Hat Linux Based:

  • Fedora
  • CentOS
  • RHEL
  • Oracle

OpenSUSE Linux Based:

  • Leap
  • TumbleWeed
  • SLES

Arch Linux Based:

  • Arch
  • Manjaro

Alpine Linux Based:

  • Alpine

BSD Based:

  • FreeBSD

Release Struct

type Release struct {
	Runtime string
	Arch    string
	Name    string
	Version string
	win     WindowsRelease
	nix     LinuxRelease
	bsd     BSDRelease
	osx     DarwinRelease
}

type windowsRelease struct {
	Build string
}

type linuxRelease struct {
	Distro string
	Kernel string
	PkgMng string
}

type bsdRelease struct {
	Kernel string
	PkgMng string
}

type darwinRelease struct {
	Kernel string
}

Example Usage

   package main

   import (
     "fmt"

	   "github.com/JustinTimperio/osinfo"
   )

   func main() {
		release := osinfo.GetVersion()
		release.PrintInfo()
	 }

Example Outputs

--------------------

Runtime: linux
Architecture: amd64
OS Name: Arch Linux
Version: rolling
Kernel: 5.11.2-arch1-1
Distro: arch
Package Manager: pacman

--------------------

Runtime: linux
Architecture: amd64
OS Name: Debian GNU/Linux 10 (buster)
Version: 10
Kernel: 4.19.0-13-amd64
Distro: debian
Package Manager: apt

--------------------

Runtime: windows
Architecture: amd64
OS Name: Windows Server 2016 Standard Evaluation
Version: 10
Build: 14393

--------------------

Runtime: freebsd
Architecture: amd64
OS Name: FreeBSD 12.1-RELEASE
Version: 12.1-RELEASE
Kernel: 1201000

--------------------

osinfo's People

Contributors

justintimperio avatar schmenn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.