cache

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

  • Copyright (c) 2019. Abstrium SAS <team (at) pydio.com>
  • This file is part of Pydio Cells. *
  • Pydio Cells is free software: you can redistribute it and/or modify
  • it under the terms of the GNU Affero General Public License as published by
  • the Free Software Foundation, either version 3 of the License, or
  • (at your option) any later version. *
  • Pydio Cells is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU Affero General Public License for more details. *
  • You should have received a copy of the GNU Affero General Public License
  • along with Pydio Cells. If not, see <http://www.gnu.org/licenses/>. *
  • The latest code can be found at <https://pydio.com>.

Package cache provides ready-to-use in-memory cache mechanisms

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBigCacheConfig

func DefaultBigCacheConfig() bigcache.Config

DefaultBigCacheConfig returns a bigcache default config with an eviction time of 30minutes and a HadMaxCachesize of 20MB

Types

type InstrumentedCache

type InstrumentedCache struct {
	bigcache.BigCache
	// contains filtered or unexported fields
}

InstrumentCache wraps BigCache with metrics

func NewInstrumentedCache

func NewInstrumentedCache(serviceName string, cacheConfig ...bigcache.Config) *InstrumentedCache

NewInstrumentedCache creates a BigCache instance with a regular report of statistics

func (*InstrumentedCache) Close

func (i *InstrumentedCache) Close()

Close stops internal timer for reporting statistics

func (*InstrumentedCache) Set

func (i *InstrumentedCache) Set(key string, entry []byte) error

Set adds a key/value to the cache.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL