tools

package
v0.0.0-...-3f94a61 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, s string) int

Contains 数组是否包含某元素

func CurrentUsername

func CurrentUsername() string

CurrentUsername returns the username of the current user.

func GetLocalIP

func GetLocalIP() (ip string, err error)

func GetNetworkIPv4

func GetNetworkIPv4() string

func GetNetworkIp

func GetNetworkIp() string

func GetOutboundIP

func GetOutboundIP() (string, error)

func GetVersionNum

func GetVersionNum(ver string) int

func GetXForEc

func GetXForEc(ec float64, times int, multiple int) float64

获取

func GetXForEcIncr

func GetXForEcIncr(x float64, times int, multiple int) float64

func IsExist

func IsExist(path string) bool

IsExist returns true if a file or directory exists.

func IsFile

func IsFile(path string) bool

IsFile returns true if given path exists as a file (i.e. not a directory).

func RandId

func RandId() string

Types

type Address

type Address struct {
	Country  string `json:"Country"`
	Province string `json:"Province"`
	City     string `json:"City"`
}

type IPLocate

type IPLocate struct {
	Result  bool    `json:"result"`
	IP      string  `json:"IP"`
	Address Address `json:"Address"`
	ISP     string  `json:"ISP"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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