util

package
v0.8.698 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsPort

func ContainsPort(portRanges [][2]int64, port int64) bool

func GetAuthKey

func GetAuthKey(token string, timestamp int64) (key string)

func GetPortRanges

func GetPortRanges(rangeStr string) (portRanges [][2]int64, err error)

for example: rangeStr is "1000-2000,2001,2002,3000-4000", return an array as port ranges.

func IsPortValid

func IsPortValid(port int) bool

func IsTCPPortAvailable

func IsTCPPortAvailable(port int) bool

IsTCPPortAvailable returns a flag indicating whether or not a TCP port is available.

func PortRangesCut

func PortRangesCut(portRanges [][2]int64, port int64) [][2]int64

func RandId

func RandId() (id string, err error)

RandId return a rand string used in frp.

func RandIdWithLen

func RandIdWithLen(idLen int) (id string, err error)

RandIdWithLen return a rand string with idLen length.

func RandomTCPPort

func RandomTCPPort() int

RandomTCPPort gets a free, random TCP port between 1025-65535. If no free ports are available -1 is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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