Documentation ¶
Index ¶
- Variables
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func CheckAuth(smtpHost string, smtpPort uint, email, pwd string, timeout time.Duration) error
- func Crop(w io.Writer, r io.Reader, rect image.Rectangle, imgType SupportedImgType) error
- func Markdown2html(mdStr string) string
- func Md5Bytes(data []byte) []byte
- func Md5String(data []byte) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func Resize(w io.Writer, r io.Reader, width, height uint, imgType SupportedImgType) error
- func Thumbnails(w io.Writer, r io.Reader, rect image.Rectangle, width, height uint, ...) error
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type SupportedImgType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidImgType = errors.New("invalid image type")
)
View Source
var (
ErrTimeout = errors.New("timeout")
)
Functions ¶
func Markdown2html ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func Thumbnails ¶
func Thumbnails(w io.Writer, r io.Reader, rect image.Rectangle, width, height uint, imgType SupportedImgType) error
裁剪图片指定区域并将该区域缩放为指定大小的宽和高。
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type SupportedImgType ¶
type SupportedImgType string
系统当前支持的图片类型
const ( IMG_PNG SupportedImgType = ".png" IMG_JPEG SupportedImgType = ".jpg" )
func Convert2ImgType ¶
func Convert2ImgType(fileExt string) (SupportedImgType, error)
Click to show internal directories.
Click to hide internal directories.