Documentation ¶
Index ¶
- Constants
- func AlignLeft(str string, width int, char byte) string
- func AlignRight(str string, width int, char byte) string
- func ByteToJson(data *[]byte) (*simplejson.Json, error)
- func CopyFile(src, dst string) (err error)
- func CreateZip(path, ph string) error
- func DAoffSec(t time.Time, off int) int
- func DAsec(off int) int
- func DebugOff()
- func DebugOn()
- func DebugPrint(a ...interface{}) (n int, err error)
- func DebugPrintf(format string, a ...interface{}) (n int, err error)
- func DebugPrintln(a ...interface{}) (n int, err error)
- func DirFileNum(ph string) int
- func DirName(path string) string
- func DirSize(path string) int64
- func Dup(str string, num int) string
- func DupChar(char byte, num int) string
- func Exists(name string) bool
- func ExistsDir(name string) bool
- func ExistsF(name string, callback func(os.FileInfo) bool) bool
- func ExistsFile(aph string) bool
- func ExistsIsDir(name string) bool
- func ExistsIsFile(name string) bool
- func FWrite(path string, data []byte) error
- func FcheckParents(aph string)
- func Fexists(ph string) bool
- func Fi(ph string) os.FileInfo
- func Fif(f *os.File) os.FileInfo
- func FileA(ph string) *os.File
- func FileAF(ph string, callback func(*os.File))
- func FileO(ph string, flag int) *os.File
- func FileOF(ph string, flag int, callback func(*os.File))
- func FileR(ph string) *os.File
- func FileRF(ph string, callback func(*os.File))
- func FileType(name string) string
- func FileW(ph string) *os.File
- func FileWF(ph string, callback func(*os.File))
- func FindDirHeadFile(ph string, head string) string
- func Finger(h hash.Hash, ph string) string
- func Fmove(frompath, topath string) error
- func Fnew(ph string) error
- func Fremove(ph string) (err error)
- func Fsz(ph string) int64
- func Fszf(f *os.File) int64
- func GetIntMac(v string) string
- func GetMac() string
- func GetTime() string
- func ImageDrawRGBA(img *image.RGBA, imgcode image.Image, x, y int)
- func ImageDrawRGBAOffSet(img *image.RGBA, imgcode image.Image, r image.Rectangle, x, y int)
- func ImageEncodeJPEG(ph string, img image.Image, option int) error
- func ImageEncodePNG(ph string, img image.Image) error
- func ImageJPEG(ph string) (image.Image, error)
- func ImagePNG(ph string) (image.Image, error)
- func ImageRGBA(width, height int) *image.RGBA
- func IndexOfBytes(array []byte, one byte) int
- func IndexOfStrings(array []string, one string) int
- func InterfaceToJson(data *interface{}) (*simplejson.Json, error)
- func IsBlank(s string) bool
- func IsDebugOn() bool
- func IsInStrings(array []string, one string) bool
- func IsSpace(c byte) bool
- func JsonDecode(r io.Reader, v interface{}) error
- func JsonFromBytes(bs []byte, v interface{}) error
- func JsonFromString(str string, v interface{}) error
- func LinuxBash(sh string) error
- func LinuxCmd(sh string) error
- func MD5(ph string) string
- func Mkdir(ph string) error
- func NoError(err error)
- func PPread(r io.Reader) (pp map[string]string)
- func PPreadf(ph string) map[string]string
- func ParseDate(dstr string) time.Time
- func ParseDateTime(dtstr string) time.Time
- func Ph(ph string) string
- func Ping(addr string, i int) bool
- func Properties(ph string) map[string]string
- func RandomSHA1() string
- func Range(str string, start, end int) string
- func RemoveAll(ph string) error
- func SBlank(s, dft string) string
- func SplitIgnoreBlank(s, sep string) []string
- func StrSHA1(data string) string
- func StringBuilder() *strBuilder
- func ToFloat(data string, reData float64) float64
- func ToInt(s string, dft int) int
- func ToInt64(s string, dft int64) int64
- func Trim(s string) string
- func TrimBytes(bs []byte) string
- func TrimExtraSpace(s string) string
- func UU() string
- func UU16() string
- func UnixMsSec(off int) int64
- func UnixNano() string
- func Untar(file, path string) error
- func Utf8(bs []byte) (str string, err error)
- func Utf8f(ph string) (str string, err error)
- func Utf8r(r io.Reader) (str string, err error)
- type BeeMap
- type Region
- func (r *Region) HasLeft() bool
- func (r *Region) HasRight() bool
- func (r *Region) LeftDate() time.Time
- func (r *Region) LeftFloat() float32
- func (r *Region) LeftFloat64() float64
- func (r *Region) LeftInt() int
- func (r *Region) LeftLong() int64
- func (r *Region) RightDate() time.Time
- func (r *Region) RightFloat() float32
- func (r *Region) RightFloat64() float64
- func (r *Region) RightInt() int
- func (r *Region) RightLong() int64
- func (r *Region) String() string
Constants ¶
View Source
const ( ICMP_ECHO_REQUEST = 8 ICMP_ECHO_REPLY = 0 )
View Source
const FORMAT_DATE string = "2006-01-02"
View Source
const FORMAT_DATE_TIME string = "2006-01-02 15:04:05"
View Source
const REX_DATE string = "" /* 187-byte string literal not displayed */
yyyy-MM-dd
View Source
const REX_DATE_TIME string = "" /* 238-byte string literal not displayed */
yyyy-MM-dd hh:mm:ss
View Source
const REX_FLOAT string = "^(-?)(\\d+)\\.(\\d+)$"
正负浮点数
View Source
const REX_INT string = "^(-?)(\\d+)$"
正负整数
Variables ¶
This section is empty.
Functions ¶
func ByteToJson ¶
func ByteToJson(data *[]byte) (*simplejson.Json, error)
将Byte转换为一个simplejson.Json对象指针返回
func DebugPrint ¶
func DebugPrintf ¶
func DebugPrintln ¶
func ImageDrawRGBAOffSet ¶
将图片绘制到图片
func ImageEncodeJPEG ¶
JPEG将编码生成图片 选择编码参数,质量范围从1到100,更高的是更好 &jpeg.Options{90}
func InterfaceToJson ¶
func InterfaceToJson(data *interface{}) (*simplejson.Json, error)
将一个interface{}转换为一个simplejson.Json对象指针返回
func ParseDateTime ¶
func Properties ¶
读取多行属性文件,并将其变成一个 map,如果文件不存在,返回一个空 map
func SplitIgnoreBlank ¶
拆分字符串数组,如果数组元素为空白,忽略,否则则 Trim 空白
func StringBuilder ¶
func StringBuilder() *strBuilder
提供一个类似java中stringBuilder对象,支持链式调用(不返回错误信息,直接panic) str := SBuilder().Append("abc=123").Append('\n').String() TODO 等着测试下性能,看看用字符数组来实现是不是效率高些
func TrimExtraSpace ¶
Trim并且去掉中间多余的空白(多个空白变一个空白) 比如 " a b c d e" -> "a b c d e"
func UU ¶
func UU() string
生成一个 UUID 字符串(小写,去掉减号),需要系统支持 "uuidgen" 命令 返回的字符串格式如 "1694108edc6348b08364e604dee1bf35"
Types ¶
type BeeMap ¶
type BeeMap struct {
// contains filtered or unexported fields
}
type Region ¶
type Region struct { Left interface{} Right interface{} LeftOpen bool RightOpen bool // contains filtered or unexported fields }
func MakeRegion ¶
func (*Region) LeftFloat64 ¶
func (*Region) RightFloat ¶
func (*Region) RightFloat64 ¶
Click to show internal directories.
Click to hide internal directories.