MCPcopy Create free account
hub / github.com/UiPath/uipathcli / Get

Method Get

cache/file_cache.go:24–34  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

22type FileCache struct{}
23
24func (c FileCache) Get(key string) (string, time.Time) {
25 expires, value, err := c.readValue(key)
26 if err != nil {
27 return "", time.Time{}
28 }
29 expiresAt := time.Unix(expires, 0).UTC()
30 if expiresAt.Before(time.Now().UTC()) {
31 return "", time.Time{}
32 }
33 return value, expiresAt
34}
35
36func (c FileCache) Set(key string, value string, expiresAt time.Time) {
37 path, err := c.cacheFilePath(key)

Calls 1

readValueMethod · 0.95