util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Address

func Address(u *url.URL) string

func AddressIP

func AddressIP(add string) string

func BoolToString

func BoolToString(flag bool) string

func ByteView

func ByteView(size int64) string

func CheckPassword

func CheckPassword(crtyptPwd string, inputPwd string) bool

func Connect

func Connect(address string, timeout int) bool

func ConnectCopy

func ConnectCopy(in io.ReadWriteCloser, out io.ReadWriteCloser)

func ConnectCopyWithTimeout

func ConnectCopyWithTimeout(in net.Conn, out net.Conn, tmout int)

func CryptPassword

func CryptPassword(pwd string) string

func EthGet

func EthGet() (map[string]string, error)

func GetDate

func GetDate() string

func GetID

func GetID() string

func GetTimeStamp

func GetTimeStamp() string

func GetTimeStampNumber

func GetTimeStampNumber() string

func GetToken

func GetToken(length int) string

func HostnameGet

func HostnameGet() string

func Listen

func Listen(address string) (net.Listener, error)

func LogInit

func LogInit(dir string, filename string)

func Percent

func Percent(total int, used int) int

func Rand

func Rand(max int) int

func SaveToFile

func SaveToFile(name string, body []byte) error

func StringDiff

func StringDiff(oldlist []string, newlist []string) ([]string, []string)

func StringList

func StringList(list []string) string

func StringToInt

func StringToInt(value string) int

func TablePage

func TablePage(page, limit int, cnt int) (int, int)

func TenThousandPercent

func TenThousandPercent(total int, used int) int

func TlsConfigClient

func TlsConfigClient(servername string) (*tls.Config, error)

func TlsConfigServer

func TlsConfigServer(address ...string) (*tls.Config, error)

func Unzip

func Unzip(zipFile string, destDir string) error

func VersionGet

func VersionGet() string

func WriteFull

func WriteFull(w io.Writer, body []byte) error

func Zip

func Zip(srcFile string, destZip string) error

srcFile could be a single file or a directory

Types

type LogChannel

type LogChannel struct {
	// contains filtered or unexported fields
}

func NewLogChannel

func NewLogChannel() *LogChannel

func (*LogChannel) Listen

func (lc *LogChannel) Listen() <-chan []byte

func (*LogChannel) Write

func (lc *LogChannel) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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