Documentation ¶
Index ¶
- Variables
- func AesDecrypt(crypted, key []byte) (res []byte, err error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func DeepFields(ifaceType reflect.Type) []reflect.StructField
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{})
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type BaiDuData
- type DuduAes
- type DuduFile
- func (*DuduFile) CopyDir(source string, dest string) (err error)
- func (*DuduFile) CopyFile(source string, dest string) (err error)
- func (*DuduFile) GetAppName() string
- func (*DuduFile) GetConfigPath() string
- func (*DuduFile) GetCurrentDirectory() string
- func (*DuduFile) GetFileContentType(out *os.File) (string, error)
- func (*DuduFile) GetFileSize(path string) (int64, error)
- func (*DuduFile) GetProjectPath() string
- func (*DuduFile) IsBinary(content string) bool
- func (*DuduFile) IsDir(path string) bool
- func (*DuduFile) IsExist(path string) bool
- func (*DuduFile) Mkdir(path string) bool
- type DuduGo
- type DuduLog
- type DuduNet
- type DuduOS
- type DuduPanic
- type DuduRand
- func (*DuduRand) Int(min, max int) int
- func (*DuduRand) Int64(min, max int64) int64
- func (*DuduRand) IntAdd(min, max int) int
- func (*DuduRand) IntNoRepeat(start int, end int, count int) []int
- func (*DuduRand) Ints(from, to, size int) []int
- func (*DuduRand) String(length int) string
- func (*DuduRand) StringByNum(lenString int) string
- func (*DuduRand) StringByStr(lenString int) string
- type DuduRet
- func (*DuduRet) NewResult() *Result
- func (*DuduRet) RetGzJSON(w http.ResponseWriter, r *http.Request, res map[string]interface{})
- func (*DuduRet) RetGzResult(w http.ResponseWriter, r *http.Request, res *Result)
- func (*DuduRet) RetJSON(w http.ResponseWriter, r *http.Request, res map[string]interface{})
- func (*DuduRet) RetResult(w http.ResponseWriter, r *http.Request, res *Result)
- type DuduRune
- type DuduStr
- func (*DuduStr) Contains(str string, strs []string) bool
- func (*DuduStr) FromBytes(bytes []byte) string
- func (*DuduStr) IsMobile(phone string) int32
- func (*DuduStr) LCS(s1 string, s2 string) string
- func (*DuduStr) Md5Str(str string) string
- func (*DuduStr) StringToHtml(text string) string
- func (*DuduStr) ToBytes(str string) []byte
- type DuduTpl
- func (*DuduTpl) AssetsCSS(text string) template.HTML
- func (*DuduTpl) AssetsJs(text string) template.HTML
- func (*DuduTpl) Compare(a, b interface{}) (equal bool)
- func (*DuduTpl) CompareNot(a, b interface{}) (equal bool)
- func (*DuduTpl) Date(t time.Time, format string) string
- func (*DuduTpl) DateDayRand(t time.Time, format string) string
- func (*DuduTpl) DateFormat(t time.Time, layout string) (datestring string)
- func (*DuduTpl) DateParse(dateString, format string) (time.Time, error)
- func (*DuduTpl) HTML2str(html string) string
- func (*DuduTpl) HighLight(content string) string
- func (*DuduTpl) HtmlFilter(content string) string
- func (*DuduTpl) Htmlquote(text string) string
- func (*DuduTpl) Htmlunquote(text string) string
- func (*DuduTpl) MapGet(arg1 interface{}, arg2 ...interface{}) (interface{}, error)
- func (*DuduTpl) NotNil(a interface{}) (isNil bool)
- func (*DuduTpl) ParseForm(form url.Values, obj interface{}) error
- func (*DuduTpl) RenderForm(obj interface{}) template.HTML
- func (*DuduTpl) Str2html(raw string) template.HTML
- func (*DuduTpl) Substr(s string, start, length int) string
- type DuduUrl
- func (*DuduUrl) GetBaiDu(domain string, urls []string) bool
- func (*DuduUrl) GetDomain(url string) (string, string, string)
- func (*DuduUrl) GetDomainByRegexp(url string, domainList []string) (string, string, string, error)
- func (*DuduUrl) PostBaiDu(dataType int, domain, token string, urls []string) (int, int)
- func (*DuduUrl) PostSm(userName, domain, token string, urls []string) int
- type DuduZip
- type LogConfig
- type Option
- type Result
- type SmData
- type ZipFile
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func DeepFields ¶
func DeepFields(ifaceType reflect.Type) []reflect.StructField
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func StructCopy ¶
func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{})
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type DuduFile ¶
type DuduFile byte
func (*DuduFile) GetFileContentType ¶
获取文件类型
type DuduGo ¶
type DuduGo byte
func (*DuduGo) GetApiPath ¶
GetAPIPath gets the Go source code path $GOROOT/src.
func (*DuduGo) GetExecutableInGOBIN ¶
GetExecutableInGOBIN gets executable file under GOBIN path.
The specified executable should not with extension, this function will append .exe if on Windows.
func (*DuduGo) GetGoFormats ¶
GetGoFormats gets Go format tools. It may return ["gofmt", "goimports"].
type DuduNet ¶
type DuduNet byte
type DuduOS ¶
type DuduOS byte
func (*DuduOS) Home ¶
Home returns the home directory for the executing user.
This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.
type DuduRand ¶
type DuduRand byte
func (*DuduRand) IntNoRepeat ¶
生成count个[start,end)结束的不重复的随机数
type DuduRet ¶
type DuduRet byte
func (*DuduRet) RetGzJSON ¶
RetGzJSON writes HTTP response with "Content-Type, application/json" and "Content-Encoding, gzip".
func (*DuduRet) RetGzResult ¶
RetGzResult writes HTTP response with "Content-Type, application/json" and "Content-Encoding, gzip".
type DuduRune ¶
type DuduRune byte
func (*DuduRune) IsNumOrLetter ¶
IsNumOrLetter checks the specified rune is number or letter.
type DuduStr ¶
type DuduStr byte
func (*DuduStr) LCS ¶
LCS gets the longest common substring of s1 and s2.
Refers to http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring.
type DuduTpl ¶
type DuduTpl byte
func (*DuduTpl) Compare ¶
Compare is a quick and dirty comparison function. It will convert whatever you give it to strings and see if the two values are equal. Whitespace is trimmed. Used by the template parser as "eq".
func (*DuduTpl) CompareNot ¶
CompareNot !Compare
func (*DuduTpl) DateFormat ¶
DateFormat takes a time and a layout string and returns a string with the formatted date. Used by the template parser as "dateformat"
func (*DuduTpl) Htmlunquote ¶
Htmlunquote returns unquoted html string.
func (*DuduTpl) MapGet ¶
MapGet getting value from map by keys usage:
Data["m"] = M{ "a": 1, "1": map[string]float64{ "c": 4, }, }
{{ map_get m "a" }} // return 1 {{ map_get m 1 "c" }} // return 4
func (*DuduTpl) RenderForm ¶
RenderForm will render object to form html. obj must be a struct pointer.
type DuduUrl ¶
type DuduUrl byte
func (*DuduUrl) GetDomainByRegexp ¶
通过正则分离域名,提取二级域名,主域名,端口号
type DuduZip ¶
type DuduZip byte
type Result ¶
type Result struct { Code int `json:"code"` // return code Msg string `json:"msg"` // message Data interface{} `json:"data"` // data object }
Result represents a common-used result struct.
type ZipFile ¶
type ZipFile struct {
// contains filtered or unexported fields
}
ZipFile represents a zip file.
func (*ZipFile) AddDirectory ¶
AddDirectory adds a directory.
func (*ZipFile) AddDirectoryN ¶
AddDirectoryN adds directories.