MCPcopy Create free account
hub / github.com/devfeel/dotweb / GetInt64

Method GetInt64

cache/runtime/cache_runtime.go:92–104  ·  view source on GitHub ↗

returns value int64 format by given key if non-existed or expired, return 0.

(key string)

Source from the content-addressed store, hash-verified

90// returns value int64 format by given key
91// if non-existed or expired, return 0.
92func (ca *RuntimeCache) GetInt64(key string) (int64, error) {
93 v, err := ca.GetString(key)
94 if err != nil || v == "" {
95 return ZeroInt64, nil
96 } else {
97 i, e := strconv.ParseInt(v, 10, 64)
98 if e != nil {
99 return ZeroInt64, e
100 } else {
101 return i, nil
102 }
103 }
104}
105
106// Set cache to runtime.
107// ttl is second, if ttl is 0, it will be forever till restart.

Callers

nothing calls this directly

Calls 1

GetStringMethod · 0.95

Tested by

no test coverage detected