extnet

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package extnet 扩展net包, 提供ip到数值的转换

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPMaskToString

func IPMaskToString(mask net.IPMask) string

IPMaskToString mask 转为点分十进制作字符串

func IPToNumber

func IPToNumber(p net.IP) (uint32, error)

IPToNumber net.IP转换为数值

func NumberToIP

func NumberToIP(l uint32) net.IP

NumberToIP 数值转换为net.IP

func NumberToIPstring

func NumberToIPstring(l uint32) string

NumberToIPstring 数值转换为点分十进制字符串

func ParseIPMask

func ParseIPMask(s string) net.IPMask

ParseIPMask parses s as an IP address, returning the result. The string s can be in dotted decimal ("192.0.2.1") or IPv6 ("2001:db8::68") form. If s is not a valid textual representation of an IP address, ParseIP returns nil.

func ParseIPToNumber

func ParseIPToNumber(s string) (uint32, error)

ParseIPToNumber 点分十进制字符串转换数值

Types

This section is empty.

Jump to

Keyboard shortcuts

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