Empeld
Empeld plugin documentation.
pluginbase.Dependencies.ICacheProvider Interface Reference

Per-system cache provider. Specific to the plugin More...

Public Member Functions

bool Exists (string slug)
 Check if the cache item with the specific slug exists More...
 
Stream OpenRead (string slug)
 Open a cache item for reading. Will throw exception if not found Will decompress automatically if compression was enabled More...
 
Stream OpenWrite (string slug, bool truncate=true, bool compress=false)
 Open a cache item for writing Will overwrite any existing data More...
 
void Write< T > (string slug, T obj)
 Write an object of type T to a cache object More...
 
Read< T > (string slug)
 Read the specified slug. Will return default(T) if it doesn't exist More...
 
Read< T > (string slug, T def)
 Read the specified slug. Will return def/// More...
 
void Delete (string slug)
 Delete the cache item with the slug More...
 

Detailed Description

Per-system cache provider. Specific to the plugin

Attribute: Injectable

Member Function Documentation

◆ Delete()

void pluginbase.Dependencies.ICacheProvider.Delete ( string  slug)

Delete the cache item with the slug

Parameters
slugSlug.

◆ Exists()

bool pluginbase.Dependencies.ICacheProvider.Exists ( string  slug)

Check if the cache item with the specific slug exists

Parameters
slugSlug.

◆ OpenRead()

Stream pluginbase.Dependencies.ICacheProvider.OpenRead ( string  slug)

Open a cache item for reading. Will throw exception if not found Will decompress automatically if compression was enabled

Returns
The stream.
Parameters
slugSlug.

◆ OpenWrite()

Stream pluginbase.Dependencies.ICacheProvider.OpenWrite ( string  slug,
bool  truncate = true,
bool  compress = false 
)

Open a cache item for writing Will overwrite any existing data

Returns
The stream.
Parameters
slugSlug.
truncateTruncate any existing file
compressIf true, will use gzip compression. Truncate must also be true.

◆ Read< T >() [1/2]

T pluginbase.Dependencies.ICacheProvider.Read< T > ( string  slug)

Read the specified slug. Will return default(T) if it doesn't exist

Parameters
slugSlug.
Template Parameters
TThe type of the cache object.

◆ Read< T >() [2/2]

T pluginbase.Dependencies.ICacheProvider.Read< T > ( string  slug,
def 
)

Read the specified slug. Will return def///

Attribute: ault

if it doesn't exist.

Parameters
slugSlug.
defDef.
Template Parameters
TThe type of the cache.

◆ Write< T >()

void pluginbase.Dependencies.ICacheProvider.Write< T > ( string  slug,
obj 
)

Write an object of type T to a cache object

Parameters
slugSlug.
objObject.
Template Parameters
TObject type

The documentation for this interface was generated from the following file: