platforms

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Windows = "windows"
	Linux   = "linux"
	Android = "android"
	IOS     = "ios"
	BSD     = "bsd"
	Unix    = "unix"
	MacOS   = "darwin"
)

OS 系统

View Source
const (
	I386  = "i386"
	AMD64 = "amd64"
	ARM64 = "arm64"
	ARM32 = "arm32"
)

Arch 架构

Variables

This section is empty.

Functions

This section is empty.

Types

type OS

type OS interface {
	Name() string
	Version() string
}

OS 接口用于获取操作系统信息

type Platform

type Platform interface {

	// 返回系统对象
	GetOS() OS

	// 返回系统名称
	OS() string

	// 返回架构名称
	Arch() string
}

Platform 定义一个跨平台的统一接口

func Current added in v0.0.63

func Current() Platform

Current 函数用于获取 Platform 接口的实例

Jump to

Keyboard shortcuts

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