util

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(buffer io.Reader, byteOrder binary.ByteOrder, outputs ...interface{}) error

Decode decodes data from io reader to specified interfaces

Example:

var num1 uint16 var num2 uint32 // read the buffer 2 bytes and 4 bytes sequentially // decode and output corresponding uint16 and uint32 number into num1 and num2 respectively err := Decode(buffer, &num1, &num2)

func Encode added in v0.3.0

func Encode(buff io.Writer, byteOrder binary.ByteOrder, inputs ...interface{}) error

Encode writes the multiple inputs of different possible datatypes to the io writer.

func ResolveDNSAddress added in v0.4.4

func ResolveDNSAddress(address string, isIPv6 bool) (string, error)

ResolveDNSAddress gets ip:port or dns:port as input and resolves the dns name if exists then return ip:port

Types

This section is empty.

Jump to

Keyboard shortcuts

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