libstar

package
v0.4.83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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",
	// contains filtered or unexported fields
}
View Source
var XML = xmlUtils{}

Functions

func Catch

func Catch(name string)

func Close

func Close()

func Debug

func Debug(format string, v ...interface{})

func Error

func Error(format string, v ...interface{})

func Fatal

func Fatal(format string, v ...interface{})

func FunName

func FunName(i interface{}) string

func GenEthAddr

func GenEthAddr(n int) []byte

func GenToken

func GenToken(n int) string

func H2D8 added in v0.2.11

func H2D8(h string) uint8

func H2D16 added in v0.2.11

func H2D16(h string) uint16

func IP4Network2Range added in v0.4.83

func IP4Network2Range(addr, mask net.IP) (net.IP, net.IP)

func IP4Network2RangeN added in v0.4.83

func IP4Network2RangeN(addr, mask net.IP, n uint32) (net.IP, net.IP)

func Info

func Info(format string, v ...interface{})

func Init

func Init(file string, level int)

func Netmask2Len

func Netmask2Len(s string) int

func ParseIP4Netmask added in v0.4.83

func ParseIP4Netmask(addr, prefix string) (net.IP, net.IP)

func PrettyBytes

func PrettyBytes(b uint64) string

func PrettyDrive added in v0.2.11

func PrettyDrive(ctl, bus, tgt, unit uint16) string

func PrettyKBytes

func PrettyKBytes(k uint64) string

func PrettyPCI added in v0.2.11

func PrettyPCI(dom, bus, slot, fun uint16) string

func PrettySecs

func PrettySecs(t uint64) string

func Print added in v0.2.11

func Print(format string, v ...interface{})

func SetLog

func SetLog(level int)

func ToBytes

func ToBytes(v, u string) uint64

func Warn

func Warn(format string, v ...interface{})

Types

type Dir

type Dir struct {
}

func (Dir) ListDirs

func (d Dir) ListDirs(dirPth string) (dirs []string, err error)

func (Dir) ListFiles

func (d Dir) ListFiles(dirPth string, suffix string) (files []string, err error)

type Err

type Err struct {
	Code    int
	Message string
}

func NewErr

func NewErr(message string, v ...interface{}) (e *Err)

func (*Err) Error

func (e *Err) Error() string

func (*Err) String

func (e *Err) String() string

type Logger

type Logger struct {
	Level    int
	FileName string
	FileLog  *log.Logger
	// contains filtered or unexported fields
}

func (*Logger) Debug

func (l *Logger) Debug(format string, v ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, v ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(format string, v ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, v ...interface{})

func (*Logger) Print

func (l *Logger) Print(format string, v ...interface{})

func (*Logger) SaveError

func (l *Logger) SaveError(format string, v ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, v ...interface{})

Jump to

Keyboard shortcuts

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