Documentation
¶
Index ¶
- Constants
- func CheckFFmpegInstalled() bool
- func ClearUserSession(c *gin.Context) error
- func CompressImageWithFFmpeg(inputData []byte, ext string) ([]byte, error)
- func CompressVideoWithFFmpeg(inputPath string) (string, error)
- func GetFirstLine(text string) string
- func GetUserSession(c *gin.Context) (models.User, bool)
- func InitSession(r *gin.Engine)
- func MD5Encrypt(str string) string
- func MdToHTML(md []byte) []byte
- func SaveUserSession(c *gin.Context, user models.User) error
- func TruncateText(text string, maxLength int) string
- func UploadAttachmentToCloud(cfg *models.SiteConfig, fileName string, content io.ReadSeeker, ...) (string, error)
- func UploadImage(c *gin.Context, allowedExtensions []string, siteConfig *models.SiteConfig) (string, error)
- func UploadVideo(c *gin.Context, allowedExtensions []string, siteConfig *models.SiteConfig) (string, error)
Constants ¶
View Source
const (
UserKey = "user"
)
Variables ¶
This section is empty.
Functions ¶
func CompressImageWithFFmpeg ¶
CompressImageWithFFmpeg 使用 FFmpeg 压缩图片
func CompressVideoWithFFmpeg ¶
func UploadAttachmentToCloud ¶
func UploadAttachmentToCloud(cfg *models.SiteConfig, fileName string, content io.ReadSeeker, contentType string) (string, error)
UploadAttachmentToCloud 上传附件到云存储
func UploadImage ¶
func UploadImage(c *gin.Context, allowedExtensions []string, siteConfig *models.SiteConfig) (string, error)
UploadImage 上传图片并返回图片的URL
func UploadVideo ¶
func UploadVideo(c *gin.Context, allowedExtensions []string, siteConfig *models.SiteConfig) (string, error)
UploadVideo 上传视频并返回视频的URL
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.