Documentation ¶
Index ¶
- func DecodeXMLToMap(r io.Reader) (m map[string]string, err error)
- func EncodeXMLFromMap(w io.Writer, m map[string]string, rootname string) (err error)
- func FormatTime(t time.Time) string
- func GbkToUtf8(s []byte) ([]byte, error)
- func Now() int
- func ParseTime(value string) (time.Time, error)
- func RandString(length int) string
- func Sha1(key string) string
- func TrimBytesSpace(src []byte) []byte
- func TrimStringSpace(src string) string
- func URLValuesToStruct(value url.Values, out interface{}) error
- func Utf8ToGbk(s []byte) ([]byte, error)
- type List
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeXMLToMap ¶
DecodeXMLToMap decodes xml reading from io.Reader and returns the first-level sub-node key-value set, if the first-level sub-node contains child nodes, skip it.
func EncodeXMLFromMap ¶
EncodeXMLFromMap encodes map[string]string to io.Writer with xml format.
NOTE: This function requires the rootname argument and the keys of m (type map[string]string) argument are legitimate xml name string that does not contain the required escape character!
func TrimBytesSpace ¶
* TrimBytesSpace * 去掉 src 开头和结尾的空白, 如果 src 包括换行, 去掉换行和这个换行符两边的空白 * TrimSpace NOTE: 根据 '\n' 来分行的, 某些系统或软件用 '\r' 来分行, 则不能正常工作.
func TrimStringSpace ¶
* TrimStringSpace src string * 去掉 src 开头和结尾的空白, 如果 src 包括换行, 去掉换行和这个换行符两边的空白 * NOTE: 根据 '\n' 来分行的, 某些系统或软件用 '\r' 来分行, 则不能正常工作.
func URLValuesToStruct ¶
URLValuesToStruct 把url.Values转成struct
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.