utilsEnv

package
v0.0.0-...-7ec6a99 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDev  = "dev"
	EnvProd = "prod"
	EnvPre  = "pre"
	EnvTest = "test"
)

Variables

View Source
var (
	//国内大区或国家
	Region string

	//所在可用区
	Zone string

	//操作系统主机名
	Hostname string

	//当前运行环境类型
	WorkEnv string

	//全产品线唯一的应用标识
	AppID string

	//染色标识
	Color string
)

Functions

func GetNetwork

func GetNetwork() (map[string]*Network, error)

Types

type Network

type Network struct {
	Index       int          `json:"index"`
	Name        string       `json:"name"`
	MAC         string       `json:"mac"`
	MTU         int          `json:"mtu"`
	Flags       string       `json:"flags"`
	IP          []*net.IPNet `json:"ip"`
	IsUp        bool         `json:"is_up"`
	IsMulticast bool         `json:"is_multicast"`
	IsBroadcast bool         `json:"is_broadcast"`
	IsLoopback  bool         `json:"is_loopback"`
}

type System

type System struct {
	OS       string              `json:"os"`
	Arch     string              `json:"arch"`
	CPU      string              `json:"cpu"`
	NumCPU   int                 `json:"num_cpu"`
	Hostname string              `json:"hostname"`
	Network  map[string]*Network `json:"network"`
}

func NewSystem

func NewSystem() (*System, error)

Jump to

Keyboard shortcuts

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