util

package
v0.0.0-...-1aa142a Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilenameSuffixInDay    = "20060102"
	FilenameSuffixInSecond = "20060102150405"
	StandardLogPrefix      = "2006/01/02 15:04:05"
)

Variables

This section is empty.

Functions

func ExecDir

func ExecDir() string

func HomeDir

func HomeDir() string

func Hostname

func Hostname() string

func HttpTalk

func HttpTalk(cli *http.Client, req *http.Request) ([]byte, error)

func IP2Long

func IP2Long(ipstr string) uint32

func Long2IP

func Long2IP(ipLong uint32) string

func NewTimeoutClient

func NewTimeoutClient(connectTimeout, readWriteTimeout time.Duration) *http.Client

func NewTimeoutClientWithProxy

func NewTimeoutClientWithProxy(connectTimeout, readWriteTimeout time.Duration, proxy func(*http.Request) (*url.URL, error)) *http.Client

func SetLogger

func SetLogger(l *Logger)

func TimeoutDialer

func TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(net, addr string) (c net.Conn, err error)

func ToLower

func ToLower(c byte) byte

func ToUpper

func ToUpper(c byte) byte

Types

type Logger

type Logger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(filenamePrefix string, filenameSuffixFormat string) *Logger

func (*Logger) Debug

func (l *Logger) Debug(content ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, content ...interface{})

func (*Logger) Error

func (l *Logger) Error(content ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(format string, content ...interface{})

func (*Logger) Info

func (l *Logger) Info(content ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(format string, content ...interface{})

func (*Logger) Notice

func (l *Logger) Notice(content ...interface{})

func (*Logger) Noticef

func (l *Logger) Noticef(format string, content ...interface{})

func (*Logger) Warning

func (l *Logger) Warning(content ...interface{})

func (*Logger) Warningf

func (l *Logger) Warningf(format string, content ...interface{})

Jump to

Keyboard shortcuts

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