Documentation ¶
Index ¶
- Constants
- Variables
- func BasicAuth(username, password string) string
- func Catch(name string)
- func Close()
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func FunName(i interface{}) string
- func GenEthAddr(n int) []byte
- func GenToken(n int) string
- func GenUUID() string
- func GetJSON(r io.ReadCloser, v interface{}) error
- func GetLocalTime(layout, value string) (time.Time, error)
- func H2D16(h string) uint16
- func H2D8(h string) uint8
- func IP4Network2Range(addr, mask net.IP) (net.IP, net.IP)
- func IP4Network2RangeN(addr, mask net.IP, n uint32) (net.IP, net.IP)
- func Info(format string, v ...interface{})
- func Init(file string, level int)
- func IsDigit(s string) bool
- func Netmask2Len(s string) int
- func ParseIP4Netmask(addr, prefix string) (net.IP, net.IP)
- func PreNotify()
- func PrettyBytes(b uint64) string
- func PrettyDrive(ctl, bus, tgt, unit uint16) string
- func PrettyKBytes(k uint64) string
- func PrettyPCI(dom, bus, slot, fun uint16) string
- func PrettySecs(t uint64) string
- func Print(format string, v ...interface{})
- func SavePID(file string) error
- func SdNotify()
- func SetLog(level int)
- func ToBytes(v, u string) uint64
- func ToKiB(v, u string) uint64
- func Wait()
- func Warn(format string, v ...interface{})
- type Auth
- type Dir
- type Err
- type HttpClient
- type Logger
- func (l *Logger) Debug(format string, v ...interface{})
- func (l *Logger) Error(format string, v ...interface{})
- func (l *Logger) Fatal(format string, v ...interface{})
- func (l *Logger) Info(format string, v ...interface{})
- func (l *Logger) List() <-chan *Message
- func (l *Logger) Print(format string, v ...interface{})
- func (l *Logger) SaveError(level string, format string, v ...interface{})
- func (l *Logger) Warn(format string, v ...interface{})
- type Message
- type PProf
- type Proxy
- type ProxyUrl
- type ProxyWs
- type WaitOne
Constants ¶
View Source
const ( PRINT = 0x00 DEUBG = 0x01 INFO = 0x02 WARN = 0x03 ERROR = 0x04 FATAL = 0xff )
Variables ¶
View Source
var ( Version string Date string Commit string )
View Source
var DIR = Dir{}
View Source
var JSON = jsonUtils{}
View Source
var Log = Logger{ Level: INFO, FileName: ".log.error", Errors: list.New(), }
View Source
var XML = xmlUtils{}
Functions ¶
func GenEthAddr ¶
func GetJSON ¶
func GetJSON(r io.ReadCloser, v interface{}) error
func Netmask2Len ¶
func PrettyBytes ¶
func PrettyDrive ¶
func PrettyKBytes ¶
func PrettySecs ¶
Types ¶
type HttpClient ¶
type HttpClient struct { Method string Url string Payload io.Reader Auth Auth TlsConfig *tls.Config Client *http.Client }
func (*HttpClient) Close ¶
func (cl *HttpClient) Close()
type Logger ¶
type Logger struct { Level int FileName string FileLog *log.Logger Lock sync.Mutex Errors *list.List }
type Proxy ¶
func (*Proxy) Initialize ¶
func (pri *Proxy) Initialize()
type ProxyUrl ¶
type ProxyUrl struct { Proxy Transport *http.Transport Filter func(*http.Response, http.ResponseWriter, interface{}) bool Data interface{} }
func (*ProxyUrl) Initialize ¶
func (pri *ProxyUrl) Initialize()
Click to show internal directories.
Click to hide internal directories.