Documentation ¶
Index ¶
- func ConvInt2Str(str int) string
- func ConvStr2Int(str string) int
- func CpuPprof()
- func CreateDir(dir string)
- func Exist(filename string) bool
- func FileExists(path string) bool
- func Get(url string) string
- func GetCurrentPath() string
- func GetExecDir() string
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetParentDirectory(dir string) string
- func GetRootPath() string
- func GetZeroTime(d time.Time) time.Time
- func GrepFile(patten string, filename string) (lines []string, err error)
- func IsFileExist(f string) bool
- func JsonDecode(data string, v interface{}) error
- func JsonEncode(v interface{}) (string, error)
- func MathDecimal(value float64) float64
- func PostForm(url string, json_input interface{}) (string, *http.Response, []error)
- func PostJson(url string, json_input interface{}) (string, *http.Response, []error)
- func PrintType(s interface{})
- func PrintVal(s interface{})
- func ReadFile(fileName string) (data []byte)
- func SearchFile(filename string, paths ...string) (fullpath string, err error)
- func SelfDir() string
- func SelfPath() string
- func WriteFile(filename string, data string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvInt2Str ¶
func ConvStr2Int ¶
func FileExists ¶
FileExists reports whether the named file or directory exists. 判断所给路径文件/文件夹是否存在
func GetCurrentPath ¶
func GetCurrentPath() string
func GetExecDir ¶
func GetExecDir() string
func GetFirstDateOfMonth ¶
获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetLastDateOfMonth ¶
获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func GrepFile ¶
GrepFile like command grep -E for example: GrepFile(`^hello`, "hello.txt") \n is striped while read
func JsonDecode ¶
func JsonEncode ¶
func PostJson ¶
json提交
json_input := map[string]interface{}{ "name": "backy", "species": "dog", }
json_input := `{"name":"backy", "species":"dog"}`
func SearchFile ¶
SearchFile Search a file in paths. this is often used in search config file in /etc ~/
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.