utils

package
v0.0.0-...-b4d0808 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirectory

func CheckDirectory(dir string) (bool, error)

CheckDirectory in FS

func ConnCopy

func ConnCopy(src, dst net.Conn, reverseChan chan int64) (err error)

ConnCopy transfer data from one socket to another one This does the actual data transfer. The broker only closes the Read side.

func CreateDirectory

func CreateDirectory(dir string) (bool, error)

CreateDirectory for log

func GenerateGUID

func GenerateGUID() string

GenerateGUID to Get a GUID

func GetMD5Hash

func GetMD5Hash(text string) string

GetMD5Hash return the Encoded HASH

func IP2Int

func IP2Int(ip string) int

IP2Int Enocde IP to a int

func InterfaceIsNil

func InterfaceIsNil(val interface{}) bool

InterfaceIsNil Check

func InterfaceValid

func InterfaceValid(val interface{}) bool

InterfaceValid Check

func ReadFileAll

func ReadFileAll(filename string) (data []byte, err error)

ReadFileAll from json file

func TCPRead

func TCPRead(conn net.Conn, size int) (data []byte, err error)

TCPRead to get data from tcp buffer

func TCPReadTimeDuration

func TCPReadTimeDuration(conn net.Conn, size int, duration time.Duration) (data []byte, err error)

TCPReadTimeDuration timeout

func TCPReadTimeout

func TCPReadTimeout(conn net.Conn, size int, millSec int) (data []byte, err error)

TCPReadTimeout control

func TCPWrite

func TCPWrite(conn net.Conn, data []byte) (writed int, err error)

TCPWrite data

func TCPWriteTimeDuration

func TCPWriteTimeDuration(conn net.Conn, data []byte, duration time.Duration) (writed int, err error)

TCPWriteTimeDuration to control timeout

func TCPWriteTimeOut

func TCPWriteTimeOut(conn net.Conn, data []byte, millSec int) (writed int, err error)

TCPWriteTimeOut control

Types

This section is empty.

Jump to

Keyboard shortcuts

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