jnet

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

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocalIPFailed = errors.New("can't get local IP")
View Source
var ErrLocalMacFailed = errors.New("can't get local mac")

Functions

func LocalIP

func LocalIP() (string, error)

LocalIP 获取本地 ip

func LocalMac

func LocalMac() (string, error)

LocalMac 获取本地 mac地址

func PickUnusedPort

func PickUnusedPort() (int, error)

PickUnusedPort 防止指定端口已经被占用,可以用下面的函数来动态获取一个可用端口。

Types

type CurlCmd

type CurlCmd struct {
	Url     string
	Headers http.Header
	Data    string
	Method  string
}

func ParseCurl

func ParseCurl(s string) (*CurlCmd, error)

func ParseCurlCmd

func ParseCurlCmd(args []string) *CurlCmd

ParseCurlCmd 解析「简单的」curl args,err:= shlex.Split(strings.ReplaceAll(s,"\\\n"," "))

Jump to

Keyboard shortcuts

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