2013-05-01 01:11:00 +00:00
|
|
|
|
using System;
|
2013-05-30 23:32:50 +00:00
|
|
|
|
using System.Collections.Generic;
|
2013-05-01 01:11:00 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Cache
|
|
|
|
|
{
|
2013-05-30 23:32:50 +00:00
|
|
|
|
public interface ICached
|
2013-05-01 01:11:00 +00:00
|
|
|
|
{
|
|
|
|
|
void Clear();
|
2013-05-30 23:32:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface ICached<T> : ICached
|
|
|
|
|
{
|
2013-07-24 00:35:35 +00:00
|
|
|
|
void Set(string key, T value, TimeSpan? lifetime = null);
|
|
|
|
|
T Get(string key, Func<T> function, TimeSpan? lifeTime = null);
|
2013-05-30 04:55:23 +00:00
|
|
|
|
T Find(string key);
|
2013-08-30 22:14:44 +00:00
|
|
|
|
void Remove(string key);
|
2013-05-30 23:32:50 +00:00
|
|
|
|
|
|
|
|
|
ICollection<T> Values { get; }
|
2013-05-01 01:11:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|