netutil

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostForm

func NewPostForm(url string, data url.Values) *http.Request

Version of http.Client.PostForm that returns a new request instead of executing it directly.

func ToUrlValues

func ToUrlValues(m map[string]string) url.Values

Types

type PortAddr

type PortAddr struct {
	IP   net.IP
	Port uint16
}

An addr that is neither restricted to TCP nor UDP, but has an IP and a port.

func ParsePortAddr

func ParsePortAddr(addr string) *PortAddr

Parses an IP address with a port, for example "209.197.29.196:27017". If the given string is not valid, this function returns nil.

func (*PortAddr) String

func (p *PortAddr) String() string

func (*PortAddr) ToTCPAddr

func (p *PortAddr) ToTCPAddr() *net.TCPAddr

func (*PortAddr) ToUDPAddr

func (p *PortAddr) ToUDPAddr() *net.UDPAddr

Jump to

Keyboard shortcuts

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