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

Method readValue

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

Source from the content-addressed store, hash-verified

44}
45
46func (c FileCache) readValue(key string) (int64, string, error) {
47 path, err := c.cacheFilePath(key)
48 if err != nil {
49 return 0, "", err
50 }
51 data, err := os.ReadFile(path)
52 if err != nil {
53 return 0, "", err
54 }
55 split := strings.Split(string(data), separator)
56 if len(split) != 2 {
57 return 0, "", errors.New("Could not split cache data")
58 }
59 expiry, err := strconv.ParseInt(split[0], 10, 64)
60 if err != nil {
61 return 0, "", err
62 }
63 value := split[1]
64 return expiry, value, nil
65}
66
67func (c FileCache) cacheFilePath(key string) (string, error) {
68 cacheDirectory, err := directories.Cache()

Callers 1

GetMethod · 0.95

Calls 2

cacheFilePathMethod · 0.95
NewMethod · 0.80

Tested by

no test coverage detected