(key string, value string, expiresAt time.Time)
| 34 | } |
| 35 | |
| 36 | func (c FileCache) Set(key string, value string, expiresAt time.Time) { |
| 37 | path, err := c.cacheFilePath(key) |
| 38 | if err != nil { |
| 39 | return |
| 40 | } |
| 41 | expires := int64(expiresAt.Unix()) |
| 42 | data := []byte(fmt.Sprintf("%d%s%s", expires, separator, value)) |
| 43 | _ = os.WriteFile(path, data, cacheFilePermissions) |
| 44 | } |
| 45 | |
| 46 | func (c FileCache) readValue(key string) (int64, string, error) { |
| 47 | path, err := c.cacheFilePath(key) |