type simpleCache … func newSimpleCache(clock clock.Clock, ttl time.Duration, providerName string) *simpleCache { … } // given a key, return the transformer, or nil if it does not exist in the cache func (c *simpleCache) get(key []byte) value.Read { … } // set caches the record for the key func (c *simpleCache) set(key []byte, transformer value.Read) { … } // keyFunc generates a string key by hashing the inputs. // This lowers the memory requirement of the cache. func (c *simpleCache) keyFunc(s []byte) string { … } // toString performs unholy acts to avoid allocations func toString(b []byte) string { … }