Documentation
¶
Overview ¶
Package cache for backend cache
Index ¶
- Variables
- type BackendCache
- func (b *BackendCache) Clear(ctx context.Context)
- func (b *BackendCache) Count() int
- func (b *BackendCache) Delete(ctx context.Context, backendName string)
- func (b *BackendCache) List(ctx context.Context) []model.Backend
- func (b *BackendCache) Load(backendName string) (model.Backend, bool)
- func (b *BackendCache) PrintCacheContent(ctx context.Context)
- func (b *BackendCache) Store(ctx context.Context, backendName string, backend model.Backend)
- type BackendCacheInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var BackendCacheProvider = BackendCacheInterface(nil)
BackendCacheProvider provider for backend cache
Functions ¶
This section is empty.
Types ¶
type BackendCache ¶
type BackendCache struct {
// contains filtered or unexported fields
}
BackendCache contains backendItems and mutex
func (*BackendCache) Clear ¶
func (b *BackendCache) Clear(ctx context.Context)
Clear set backend cache empty
func (*BackendCache) Delete ¶
func (b *BackendCache) Delete(ctx context.Context, backendName string)
Delete delete backend cache by backendName
func (*BackendCache) List ¶
func (b *BackendCache) List(ctx context.Context) []model.Backend
List get all backend cache
func (*BackendCache) Load ¶
func (b *BackendCache) Load(backendName string) (model.Backend, bool)
Load get backend from cache
func (*BackendCache) PrintCacheContent ¶
func (b *BackendCache) PrintCacheContent(ctx context.Context)
PrintCacheContent print current backend cache
type BackendCacheInterface ¶
type BackendCacheInterface interface {
// Store save backend to cache
Store(ctx context.Context, backendName string, backend model.Backend)
// Load get backend from cache
Load(backendName string) (model.Backend, bool)
// Delete delete backend cache by backendName
Delete(ctx context.Context, backendName string)
// Clear set backend cache empty
Clear(ctx context.Context)
// List get all backend cache
List(ctx context.Context) []model.Backend
// Count get backend cache length
Count() int
// PrintCacheContent print current backend cache
PrintCacheContent(ctx context.Context)
}
BackendCacheInterface interface for backend cache
Click to show internal directories.
Click to hide internal directories.