Documentation ¶ Overview ¶ internal/cache/ttl.go Index ¶ type Cache func NewComposite(cfg Config) Cache func NewFile(dir string, ttl time.Duration) Cache func NewMemory(max int, ttl time.Duration) Cache func NewRedis(addr string, ttl time.Duration) Cache type Config Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cache ¶ type Cache interface { Get(key string) ([]byte, bool) Set(key string, value []byte, ttl time.Duration) } func NewComposite ¶ func NewComposite(cfg Config) Cache func NewFile ¶ func NewFile(dir string, ttl time.Duration) Cache func NewMemory ¶ func NewMemory(max int, ttl time.Duration) Cache func NewRedis ¶ func NewRedis(addr string, ttl time.Duration) Cache type Config ¶ type Config struct { MemoryEnabled bool MemoryTTL time.Duration MemoryMax int FileEnabled bool FileTTL time.Duration FileDirectory string RedisEnabled bool RedisTTL time.Duration RedisAddress string Logger log.Logger } Source Files ¶ View all Source files cache.gofile.gomemory.goredis.gottl.go Click to show internal directories. Click to hide internal directories.