Documentation ¶
Index ¶
- Constants
- Variables
- func ErrNotConfigPointer(iface interface{}) error
- func ErrNotConnectionPointer(iface interface{}) error
- func ErrNotMigrationPointer(iface interface{}) error
- func ErrNotMutexPointer(iface interface{}) error
- func ErrNotQueueItemPointer(iface interface{}) error
- func GetEnity(ctx context.Context, provider, enityName string) (interface{}, error)
- func Registrate(ctx context.Context) context.Context
- func RegistrateEnity(ctx context.Context, provider, enityName string, options interface{}) (context.Context, error)
- func RegistrateProvider(ctx context.Context, name string, p Provider) (context.Context, error)
- type Caches
- func (c *Caches) GetAllAliveHandlers(out stats.MapCheckFunc) (stats.MapCheckFunc, error)
- func (c *Caches) GetAllMetrics(out stats.MapMetricsOptions) (stats.MapMetricsOptions, error)
- func (c *Caches) GetAllReadyHandlers(out stats.MapCheckFunc) (stats.MapCheckFunc, error)
- func (c *Caches) GetProvider(providerName string) (Provider, error)
- type Provider
Constants ¶
View Source
const (
ProvidersName = "caches"
)
Variables ¶
View Source
var ( ErrEmptyCachees = errors.New("empty caches") ErrConnectionPointerIsNil = errors.New("nil passed as connection pointer") ErrConnectionDoesNotExists = errors.New("connection does not exist") ErrMutexPointerIsNil = errors.New("nil passed as mutex pointer") ErrNotLockIDPointer = errors.New("passed lockID is not int64") ErrDBConnNotEstablished = errors.New("cache connection not established") ErrNotFoundInCache = errors.New("not found in cache") ErrNotLockKey = errors.New("passed lockID is not string") )
Functions ¶
func ErrNotConfigPointer ¶ added in v0.3.0
func ErrNotConfigPointer(iface interface{}) error
func ErrNotConnectionPointer ¶
func ErrNotConnectionPointer(iface interface{}) error
func ErrNotMigrationPointer ¶
func ErrNotMigrationPointer(iface interface{}) error
func ErrNotMutexPointer ¶
func ErrNotMutexPointer(iface interface{}) error
func ErrNotQueueItemPointer ¶
func ErrNotQueueItemPointer(iface interface{}) error
func RegistrateEnity ¶
Types ¶
type Caches ¶
type Caches struct {
*providerswithmetrics.BaseProvidersWithMetrics
}
Caches is a controlling structure for all caches and providers.
func (*Caches) GetAllAliveHandlers ¶
func (c *Caches) GetAllAliveHandlers(out stats.MapCheckFunc) (stats.MapCheckFunc, error)
GetAllAliveHandlers collect all aliveHandlers for Databases
func (*Caches) GetAllMetrics ¶
func (c *Caches) GetAllMetrics(out stats.MapMetricsOptions) (stats.MapMetricsOptions, error)
GetAllMetrics collect all metrics for Databases
func (*Caches) GetAllReadyHandlers ¶
func (c *Caches) GetAllReadyHandlers(out stats.MapCheckFunc) (stats.MapCheckFunc, error)
GetAllReadyHandlers collect all readyHandlers for Databases
type Provider ¶
type Provider interface { provider.IProvider provider.IEnityManager stats.IProviderMetrics // Get item from cache by key. Get(connectionName, key string, value interface{}) error // Set item in cache by key. Set(connectionName, key string, value interface{}) error // SetNX (Not eXist) item in cache by key. SetNX(connectionName, key string, value interface{}) error // Delete item from cache by key. Delete(connectionName, key string) error // Clear all items from selected connection. Clear(connectionName string) error // Clear all items from all connections. ClearAll() error }
Provider is an interface every cache provider should conform. Every provider can hold more than one connection.
Click to show internal directories.
Click to hide internal directories.