elastimemcache

package
v0.0.0-...-7e90556 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client is a client for an ElastiCache cluster backed by memcache.

func NewClientWithInterface

func NewClientWithInterface(
	awsClient elasticacheiface.ElastiCacheAPI,
	memcacheClient MemcacheClient,
	serverSelector ServerList,
	config Config,
) (*Client, error)

NewClientWithInterface returns a client instantiated from a custom elasticache client.

func (*Client) Close

func (c *Client) Close()

Close stops the auto discovery goroutine.

func (*Client) Get

func (c *Client) Get(key string) (string, error)

Get queries the cache for a string with the given key.

func (*Client) Set

func (c *Client) Set(key string, value string) error

Set inserts a string into the cache with the given key.

func (*Client) StartAutoDiscovery

func (c *Client) StartAutoDiscovery()

StartAutoDiscovery is a blocking function that refreshes nodes on an interval.

type Config

type Config struct {
	ClusterID string
	Namespace string
	TTL       int32
}

A Config contains the parameters required by a Client to interact with a memcache cluster.

type MemcacheClient

type MemcacheClient interface {
	Get(key string) (*memcache.Item, error)
	Set(item *memcache.Item) error
}

MemcacheClient is a client for getting and setting keys in memcache.

type ServerList

type ServerList interface {
	SetServers(servers ...string) error
	memcache.ServerSelector
}

ServerList is settable group of servers that memcache can use to choose one.

Jump to

Keyboard shortcuts

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