network

package
v0.10.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreePort

func FreePort() int

FreePort xiang.network.FreePort 获取可用端口

func IP

func IP() map[string]string

IP 读取IP地址

func ProcessFreePort

func ProcessFreePort(process *gou.Process) interface{}

ProcessFreePort xiang.network.FreePort 获取可用端口

func ProcessGet

func ProcessGet(process *gou.Process) interface{}

ProcessGet xiang.helper.Get HTTP Get

func ProcessIP

func ProcessIP(process *gou.Process) interface{}

ProcessIP xiang.network.IP IP地址

func ProcessPost

func ProcessPost(process *gou.Process) interface{}

ProcessPost xiang.helper.Post HTTP Post

func ProcessPostJSON

func ProcessPostJSON(process *gou.Process) interface{}

ProcessPostJSON xiang.helper.PostJSON HTTP Post

func ProcessPut

func ProcessPut(process *gou.Process) interface{}

ProcessPut xiang.helper.Put HTTP PUT

func ProcessPutJSON

func ProcessPutJSON(process *gou.Process) interface{}

ProcessPutJSON xiang.helper.PutJSON HTTP PUT

func ProcessSend

func ProcessSend(process *gou.Process) interface{}

ProcessSend xiang.helper.Send HTTP Send

Types

type Response

type Response struct {
	Status  int                    `json:"status"`
	Body    string                 `json:"body"`
	Data    interface{}            `json:"data"`
	Headers map[string]interface{} `json:"headers"`
}

Response 请求响应结果

func RequestGet

func RequestGet(url string, params map[string]interface{}, headers map[string]string) Response

RequestGet 发送GET请求

func RequestPost

func RequestPost(url string, data interface{}, headers map[string]string) Response

RequestPost 发送POST请求

func RequestPostJSON

func RequestPostJSON(url string, data interface{}, headers map[string]string) Response

RequestPostJSON 发送POST请求

func RequestPut

func RequestPut(url string, data interface{}, headers map[string]string) Response

RequestPut 发送PUT请求

func RequestPutJSON

func RequestPutJSON(url string, data interface{}, headers map[string]string) Response

RequestPutJSON 发送PUT请求

func RequestSend

func RequestSend(method string, url string, params map[string]interface{}, data interface{}, headers map[string]string) Response

RequestSend 发送Request请求

Jump to

Keyboard shortcuts

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