utils

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logs.BeeLogger

Functions

func CallRestAPI

func CallRestAPI(url string, jsonReq interface{}) ([]byte, error)

CallRestAPI 调用restful api

func CheckFileIsExist

func CheckFileIsExist(filename string) bool

func ExecCmd

func ExecCmd(scriptFile, cmdString string) ([]byte, error)

ExecCmd 执行 command

func ExecScript

func ExecScript(scriptPath string) ([]byte, error)

ExecScript exec script

func GBK2UTF8

func GBK2UTF8(strGBK string) (strUTF8 string)

GBK2UTF8 将GBK字符串转换成UTF8字符串

func InitConsoleLog

func InitConsoleLog()

func InitFileLog

func InitFileLog()

func ListDir

func ListDir(dirPth string) (files []string, err error)

func ListFiles

func ListFiles(dirPth string, suffix string, onlyReturnFileName bool) (files []string, err error)

func PingLoop

func PingLoop(host string, pkgCnt int, timeout int) bool

PingLoop return when success

func ReportProgress

func ReportProgress(installProgress float64, sn, title, installLog string, host string) bool

ReportProgress 上报执行结果

func UTF82GBK

func UTF82GBK(strUTF8 string) (strGBK string)

UTF82GBK 将UTF8字符串转换成GBK字符串

Types

type ISOTime

type ISOTime time.Time

ISOTime 标准库Time的别名类型。用于格式化为ISO8601标准的时间(形如'2015-09-09 09:09:09')。

func UnixSecToISOTime

func UnixSecToISOTime(unixSecond int64) ISOTime

UnixSecToISOTime UNIX秒转化成ISOTime类型

func (ISOTime) MarshalJSON

func (t ISOTime) MarshalJSON() ([]byte, error)

MarshalJSON 序列化,实现json.Marshaller接口

func (ISOTime) MarshalYAML

func (t ISOTime) MarshalYAML() (interface{}, error)

MarshalYAML 序列化成YAML

func (ISOTime) String

func (t ISOTime) String() string

func (*ISOTime) UnmarshalJSON

func (t *ISOTime) UnmarshalJSON(b []byte) error

UnmarshalJSON 反序列化,实现json.Unmarshaler接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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