Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CompressionLibrary constants.CompressionLibraryType
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // GetAPI is any cache client that can get items from the cache. GetAPI IGet // SetAPI is any cache client that can set items SetAPI ISet }
Client is a generic client structure for caches. All caches must fullfil the APIs that Client provides. Client is structured in this way to allow for easy extension of the cache package as well as ease of mocking.
type ClientAPIs ¶
type ClientAPIs interface { // IGet is an interface for all cache clients that support Get operations. IGet // ISet is an interface for all cache clients that support Set operations. ISet }
ClientAPIs consolidates the APIs that a custom cache client must implement.
type Config ¶
type Config struct { // CacheProvider is the type of cache to use. These are constants in the cache package. CacheProvider constants.CacheType // CustomConfiguration is a configuration for a custom cache client. This field is required only if CacheProvider is set to // CustomCacheType. CustomConfiguration *CustomConfig // RedisConfiguration is a configuration for a redis cache client. This field is required only if CacheProvider is set to // RedisCacheType. RedisConfiguration *RedisConfig }
Config is a configuration struct for the cache client. It allows the user to specify the type of cache they want to use as well as the configuration for that cache type.
type CustomConfig ¶
type CustomConfig struct {
Client ClientAPIs
}
CustomConfig is a configuration struct for a custom cache client.
type RedisConfig ¶
type RedisConfig struct { // RedisServerType is a constant that defines which redis server type the user is using. RedisServerType constants.RedisType // SingularConfig is the configuration for a singular redis server. This is required only if RedisServerType // is set to SingularRedisType. SingularConfig *redis.Options // ClusterConfig is the configuration for a redis cluster. This is required only if RedisServerType // is set to ClusterRedisType. ClusterConfig *redis.ClusterOptions }
RedisConfig is the configuration for the redis client.
Click to show internal directories.
Click to hide internal directories.