Documentation ¶ Index ¶ func GenerateKey(input string) string type Cache func NewCache(store storage.Storage) *Cache func (c *Cache) Get(ctx context.Context, key string) ([]byte, bool, error) func (c *Cache) Set(ctx context.Context, key string, response []byte, ttl time.Duration) error type CacheItem Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func GenerateKey ¶ func GenerateKey(input string) string Types ¶ type Cache ¶ type Cache struct { // contains filtered or unexported fields } func NewCache ¶ func NewCache(store storage.Storage) *Cache func (*Cache) Get ¶ func (c *Cache) Get(ctx context.Context, key string) ([]byte, bool, error) func (*Cache) Set ¶ func (c *Cache) Set(ctx context.Context, key string, response []byte, ttl time.Duration) error type CacheItem ¶ type CacheItem struct { Response []byte `json:"response"` CreatedAt time.Time `json:"created_at"` TTL time.Duration `json:"ttl"` } Source Files ¶ View all Source files cache.go Click to show internal directories. Click to hide internal directories.