utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProtoTCP       = "tcp"
	ProtoUDP       = "udp"
	ProtoWebsocket = "ws"
)

Variables

This section is empty.

Functions

func CompleteAddress

func CompleteAddress(address, proto string) (string, error)

CompleteAddress

@Description: 补完地址
@param address 原始地址,格式如 `192.168.0.10:9851` 或 `tcp://192.168.0.10:9851`
@param proto  协议,如 `tcp`、`udp`
@return string 地址格式如 `tcp://192.168.0.10:9851`
@return error

func GetAddress added in v0.0.3

func GetAddress(protoAddr string) (proto string, address string, err error)

GetAddress

@Description: 分拆协议和地址
@param protoAddr 格式如:`tcp://192.168.0.10:9851`
@return proto
@return address
@return err

Types

This section is empty.

Jump to

Keyboard shortcuts

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