memcached

package
v2.28.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ClusterRouter - a router to signal a full cluster route
	ClusterRouter []byte = []byte{0, 0}
)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// Nodes - the memcached nodes
	Nodes []string

	// NumConnectionsPerNode - idle connection per node
	NumConnectionsPerNode int

	// ReconnectionTimeout - the time duration between connection retries
	ReconnectionTimeout string

	// MaxWriteTimeout - the max time duration to wait a write operation
	MaxWriteTimeout string

	// MaxReadTimeout - the max time duration to wait a read operation
	MaxReadTimeout string

	// MaxWriteRetries - the maximum number of write retries
	MaxWriteRetries int

	// ReadBufferSize - the size of the read buffer in bytes
	ReadBufferSize int

	// EnableMetrics - enables the memcached metrics
	EnableMetrics bool
}

Configuration - configuration wrapper

type Memcached

type Memcached struct {
	// contains filtered or unexported fields
}

Memcached - main struct

func New

func New(tm *stats.TimelineManager, configuration *Configuration) (*Memcached, error)

New - initializes

func (*Memcached) Delete

func (mc *Memcached) Delete(router, namespace []byte, fqnKeys ...string) error

Delete - deletes an object from the cache

func (*Memcached) Get

func (mc *Memcached) Get(router, namespace []byte, fqnKeys ...string) ([]byte, bool, error)

Get - returns an object from the cache

func (*Memcached) Put

func (mc *Memcached) Put(router, value, ttl, namespace []byte, fqnKeys ...string) error

Put - puts an object in the cache

Jump to

Keyboard shortcuts

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