cloud

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README

netutil

2019年12月8日 星期日

Joshua Conero

网络助手

HttpUtil

http util,内部命令空间实例 Httpu

Documentation

Overview

Package cloud net util, Web related assistant tools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PortAddress

func PortAddress(port any) string

PortAddress turn string port as addr for net.Listen

8080 -> :8080

func PortAsWeb

func PortAsWeb(portArgs any, isHttpsArgs ...bool) string

PortAsWeb set port as web address, portArgs support parameter [2]string, []string, [2]any, []any

PortAsWeb(8080) -> http://localhost:8080

PortAsWeb([2]string{8080, 10.10.16.241}) -> http://10.10.16.241:8080

PortAsWeb([]string{8080, 10.10.16.241}) -> http://10.10.16.241:8080

PortAsWeb([2]any{8080, 10.10.16.241}) -> http://10.10.16.241:8080

PortAsWeb([]any{8080, 10.10.16.241}) -> http://10.10.16.241:8080

func PortAvailable

func PortAvailable(port uint16) uint16

PortAvailable check if port is available that next port can be used

Types

type HttpUtil

type HttpUtil struct {
}

HttpUtil http util tool

var Httpu HttpUtil

func (HttpUtil) PostForm

func (hu HttpUtil) PostForm(rUrl string, files map[string]string, data map[string]string) (*http.Response, error)

PostForm post file and form data. support multi files or data

func (HttpUtil) PostFormString

func (hu HttpUtil) PostFormString(rUrl string, files map[string]string, data map[string]string) string

PostFormString postForm post add the directly by string content

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳