forked from wenlng/go-captcha
/
asset.go
60 lines (53 loc) · 1.16 KB
/
asset.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* @Author Awen
* @Description
* @Date 2021/12/18
**/
package captcha
import "github.com/PHYLAXIS-NET/go-captcha/captcha/assets"
/**
* @Description: 获取缓存资源
* @param path
* @return []byte
* @return error
*/
func getAssetCache(path string) (ret []byte, erro error) {
return assets.GetAssetCache(path)
}
/**
* @Description: 资源是否缓存
* @param path
* @return []byte
* @return error
*/
func hasAssetCache(path string) bool {
return assets.HasAssetCache(path)
}
/**
* @Description: 清除资源缓存
* @param paths
* @return bool
*/
func clearAssetCache(paths []string) bool {
return assets.ClearAssetCache(paths)
}
/**
* @Description: 设置缓存资源
* @param path
* @return error
*/
func setAssetCache(path string, content []byte, force bool) bool {
return assets.SetAssetCache(path, content, force)
}
// =============================================
// Call API
// =============================================
// ClearAssetCacheWithPaths is a function
/**
* @Description: 根据路径清除资源缓存
* @param paths
* @return bool
*/
func ClearAssetCacheWithPaths(paths []string) bool {
return clearAssetCache(paths)
}