feedcache

package
v0.0.0-...-69efd9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package feedcache provides a quick and dirty in-memory cache for feeds.Feed objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache represents the in-memory cache.

func New

func New() *Cache

New creates a new cache.

func (*Cache) Get

func (c *Cache) Get(key string) *feeds.Feed

Get sets a value in the cache. Returns nil if object is not found in the cache or if it has expired.

func (*Cache) Set

func (c *Cache) Set(key string, value *feeds.Feed, ttl time.Duration)

Set sets a value in the cache with the given ttl.

type CacheValue

type CacheValue struct {
	// contains filtered or unexported fields
}

CacheValue represents a value in the cache. The feed and expiry is stored.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL