Documentation ¶
Index ¶
- func Base64Decode(src string) string
- func Base64Encode(src []byte) string
- func Crop(old_img string, new_img string, img_size string) bool
- func DecodeSegment(where string) map[string]interface{}
- func Display(data ...interface{})
- func EncodeSegment(where map[string]interface{}) string
- func FileSize(size int) string
- func GetClientIP() string
- func GetDisplayString(data ...interface{}) string
- func GetIpAddress(ip string) map[string]interface{}
- func GetServerIP() string
- func GetSession(key string, session revel.Session) string
- func Html2str(html string) string
- func InSlice(v string, sl []string) bool
- func InSliceIface(v interface{}, sl []interface{}) bool
- func IsDir(path string) bool
- func IsEmail(email string) bool
- func IsFile(path string) bool
- func IsMap(v interface{}) bool
- func Md5(s string) string
- func Negate(old_img string, new_img string) bool
- func RandomInt(min int, max int) int
- func RandomString(num int) string
- func Resize(old_img string, new_img string, img_size string, output_align string, ...) bool
- func SliceChunk(slice []interface{}, size int) (chunkslice [][]interface{})
- func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{})
- func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
- func SliceIntersect(slice1, slice2 []interface{}) (diffslice []interface{})
- func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
- func SlicePad(slice []interface{}, size int, val interface{}) []interface{}
- func SliceRand(a []interface{}) (b interface{})
- func SliceRandList(min, max int) []int
- func SliceRange(start, end, step int64) (intslice []int64)
- func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
- func SliceShuffle(slice []interface{}) []interface{}
- func SliceSum(intslice []int64) (sum int64)
- func SliceUnique(slice []interface{}) (uniqueslice []interface{})
- func Substr(str string, length int64) string
- func Vignette(old_img string, new_img string, img_size string) bool
- func WatermarkLogo(old_img string, new_img string, logo_img string) bool
- func WatermarkText(old_img string, new_img string) bool
- type Attachment
- type BeeMap
- type Email
- type Page
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
base64加密 例如:str := utils.Base64Encode([]byte("Hello, playground"))
func Crop ¶
ImageMagick之图片裁剪 http://www.netingcn.com/imagemagick-crop.html
func DecodeSegment ¶
将编码的搜索条件,解码成搜索条件Map数组 where 搜索条件的编码字符串
func EncodeSegment ¶
将搜索条件数组编码成一个字符串 where 搜索条件Map 例如:map转换成格式 name:张三|age:20 然后Base64
func InSliceIface ¶
func InSliceIface(v interface{}, sl []interface{}) bool
InSliceIface checks given interface in interface slice.
func Negate ¶
imagemagick图片反色处理 http://www.netingcn.com/imagemagick-negate.html
func Resize ¶
func Resize(old_img string, new_img string, img_size string, output_align string, background string) bool
ImageMagick之图片缩放 http://www.netingcn.com/imagemagick-resize.html http://www.imagemagick.org/script/command-line-options.php#thumbnail 参数说明: old_img:原始图片 new_img:新图片 img_size:图片大小 output_align:位置center background:颜色
func SliceChunk ¶
func SliceChunk(slice []interface{}, size int) (chunkslice [][]interface{})
SliceChuck separates one slice to some sized slice.
func SliceDiff ¶
func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{})
SliceDiff returns diff slice of slice1 - slice2.
func SliceFilter ¶
func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
SliceFilter generates a new slice after filter function.
func SliceIntersect ¶
func SliceIntersect(slice1, slice2 []interface{}) (diffslice []interface{})
SliceIntersect returns diff slice of slice1 - slice2.
func SliceMerge ¶
func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
SliceMerge merges interface slices to one slice.
func SlicePad ¶
func SlicePad(slice []interface{}, size int, val interface{}) []interface{}
SlicePad prepends size number of val into slice.
func SliceRand ¶
func SliceRand(a []interface{}) (b interface{})
SliceRand returns random one from slice.
func SliceRandList ¶
SliceRandList generate an int slice from min to max.
func SliceRange ¶
SliceRange generates a new slice from begin to end with step duration of int64 number.
func SliceReduce ¶
func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
SliceReduce generates a new slice after parsing every value by reduce function
func SliceShuffle ¶
func SliceShuffle(slice []interface{}) []interface{}
SliceShuffle shuffles a slice.
func SliceUnique ¶
func SliceUnique(slice []interface{}) (uniqueslice []interface{})
SliceUnique cleans repeated values in slice.
func WatermarkLogo ¶
ImageMagicK给图片加水印之图片水印处理 http://www.netingcn.com/imagemagick-mark.html
func WatermarkText ¶
ImageMagicK给图片加水印之文字水印处理
Types ¶
type Attachment ¶
type Attachment struct { Filename string Header textproto.MIMEHeader Content []byte }
Attachment is a struct representing an email attachment. Based on the mime/multipart.FileHeader struct, Attachment contains the name, MIMEHeader, and content of the attachment in question
type BeeMap ¶
type BeeMap struct {
// contains filtered or unexported fields
}
func (*BeeMap) Get ¶
func (m *BeeMap) Get(k interface{}) interface{}
Get from maps return the k's value
type Email ¶
type Email struct { Auth smtp.Auth Identity string `json:"identity"` Username string `json:"username"` Password string `json:"password"` Host string `json:"host"` Port int `json:"port"` From string `json:"from"` To []string Bcc []string Cc []string Subject string Text string // Plaintext message (optional) HTML string // Html message (optional) Headers textproto.MIMEHeader Attachments []*Attachment ReadReceipt []string }
Email is the type used for email messages
func NewEMail ¶
NewEMail create new Email struct with config json. config json is followed from Email struct fields.
func (*Email) Attach ¶
Attach is used to attach content from an io.Reader to the email. Parameters include an io.Reader, the desired filename for the attachment, and the Content-Type.
func (*Email) AttachFile ¶
func (e *Email) AttachFile(filename string) (a *Attachment, err error)
Add attach file to the send mail