MCPcopy Index your code
hub / github.com/TruthHun/DocHub / getImageFromCloudStore

Method getImageFromCloudStore

models/CloudStoreModel.go:258–269  ·  view source on GitHub ↗

设置默认图片 @param picture 图片文件或者图片文件md5等 @param ext 图片扩展名,如果图片文件参数(picture)的值为md5时,需要加上后缀扩展名 @return link 图片url链接

(picture string, ext ...string)

Source from the content-addressed store, hash-verified

256//@param ext 图片扩展名,如果图片文件参数(picture)的值为md5时,需要加上后缀扩展名
257//@return link 图片url链接
258func (c *CloudStore) getImageFromCloudStore(picture string, ext ...string) (link string) {
259 if len(ext) > 0 {
260 picture = picture + "." + ext[0]
261 } else if !strings.Contains(picture, ".") && len(picture) > 0 {
262 picture = picture + ".jpg"
263 }
264 if c == nil || c.client == nil {
265 return
266 }
267
268 return c.GetSignURL(picture)
269}
270
271func (c *CloudStore) GetSignURL(object string) (link string) {
272 var err error

Callers 1

GetImageFromCloudStoreFunction · 0.95

Calls 1

GetSignURLMethod · 0.95

Tested by

no test coverage detected