GithubHelp home page GithubHelp logo

jxsl13 / osfacts Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 75 KB

osfacts is a go library for detecting os information like os family, architecture, distribution and version.

License: MIT License

Go 98.60% Makefile 1.40%
distribution facts go golang operating-system osinfo version aix linux macos

osfacts's Introduction

osfacts

Small library that allows to detect system information like operating system, its version and distribution

import

go get github.com/jxsl13/osfacts@latest

example

package main

import (
	"encoding/json"
	"fmt"

	"github.com/jxsl13/osfacts/distro"
)

func main() {
	o, err := distro.Detect()
	if err != nil {
		panic(err)
	}

	data, _ := json.MarshalIndent(o, "", " ")
	fmt.Println(string(data))
}

requirements

requires Linux kernel version 2.6.32 or newer, which is the smallest compilation target for Go. This prevents us from running on pretty old operating systems like SLES 10 and older.

  • SLES >= 11

distro package

This package supports detecting different os families, architectures, distributions and distribution versions.

supportes OS families

The distro package supports these families and detecting their distro (or os) version.

  • aix (does not have distributions)
  • darwin (different os names depending on version)
  • linux (see below)
  • solaris (see below)
  • windows

supported linux distributions

  • Alpine Linux
  • ALT Linux
  • Amazon
  • Arch Linux
  • CentOS (and CentOS Stream, TencentOS)
  • Clear Linux
  • Cumulus Linux
  • Debian
  • Deepin
  • Devuan
  • Gentoo
  • Linux Mint
  • Mandriva
  • OpenWrt
  • Oracle Linux
  • RHEL
  • Slackware
  • SMGL
  • SUSE
  • Ubuntu
  • Uos

supported solaris distributions

  • NexentaOS
  • OmniOS
  • OpenIndiana
  • SmartOS
  • Solaris (= Oracle Solaris)

windows

The windows versioning is the same as the version string provided by the WinVer.exe.

osfacts's People

Contributors

dependabot[bot] avatar john-behm-bertelsmann avatar jxsl13 avatar

Stargazers

 avatar

Watchers

 avatar  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.