os

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NanosecondLen  = 19
	MillisecondLen = 13
	SecondLen      = 10
)

Variables

This section is empty.

Functions

func Contains

func Contains(source interface{}, target interface{}) (bool, error)

Contains 判断 source 是否包含在target中,target支持类型:Array/Slice/Map

func GetBinDir

func GetBinDir() string

GetBinDir 获取当前程序所在目录

func GetBinPath

func GetBinPath() (string, error)

GetBinPath 获取当前程序完整路径

func GetENV

func GetENV(key string) string

GetENV *

func GetENVToBool

func GetENVToBool(key string) bool

GetENVToBool *

func GetENVToInt

func GetENVToInt(key string) (int, error)

GetENVToInt *

func GetENVToInt64

func GetENVToInt64(key string) (int64, error)

GetENVToInt64 *

func GetIPs

func GetIPs(filterPhysical ...bool) (ipv4 []string, err error)

GetIPs 获取当前机器IP地址,filterPhysical为true时,只获取物理络设备IP地址

func GetProjectDir

func GetProjectDir() string

GetProjectDir 获取当前程序所在目录

func IsPhysicalInterfaceDevice

func IsPhysicalInterfaceDevice(name string) (bool, error)

IsPhysicalInterfaceDevice 查看网卡是否是物理设备

func TimestampToTime

func TimestampToTime(timestamp int64) (t time.Time, err error)

TimestampToTime 时间戳转换

Types

This section is empty.

Jump to

Keyboard shortcuts

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