memcached

package
v0.0.0-...-9a5c20e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

README

memcached

import "github.com/blueprint-uservices/blueprint/runtime/plugins/memcached"

Package memcached implements a key-value [backend.Cache] client interface to a vanilla memcached implementation.

Index

type Memcached

A memcached client wrapper that implements the [backend.Cache] interface

type Memcached struct {
    backend.Cache
    Client *memcache.Client
}

func NewMemcachedClient
func NewMemcachedClient(ctx context.Context, serverAddress string) (*Memcached, error)

Instantiates a new memcached client to a memcached instance running at `serverAddress`

func (*Memcached) Delete
func (m *Memcached) Delete(ctx context.Context, key string) error

Implements the backend.Cache interface

func (*Memcached) Get
func (m *Memcached) Get(ctx context.Context, key string, value interface{}) (bool, error)

Implements the backend.Cache interface

func (*Memcached) Incr
func (m *Memcached) Incr(ctx context.Context, key string) (int64, error)

Implements the backend.Cache interface

func (*Memcached) Mget
func (m *Memcached) Mget(ctx context.Context, keys []string, values []interface{}) error

Implements the backend.Cache interface

func (*Memcached) Mset
func (m *Memcached) Mset(ctx context.Context, keys []string, values []interface{}) error

Implements the backend.Cache interface

func (*Memcached) Put
func (m *Memcached) Put(ctx context.Context, key string, value interface{}) error

Implements the backend.Cache interface

Generated by gomarkdoc

Documentation

Overview

Package memcached implements a key-value backend.Cache client interface to a vanilla memcached implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memcached

type Memcached struct {
	backend.Cache
	Client *memcache.Client
}

A memcached client wrapper that implements the backend.Cache interface

func NewMemcachedClient

func NewMemcachedClient(ctx context.Context, serverAddress string) (*Memcached, error)

Instantiates a new memcached client to a memcached instance running at `serverAddress`

func (*Memcached) Delete

func (m *Memcached) Delete(ctx context.Context, key string) error

Implements the backend.Cache interface

func (*Memcached) Get

func (m *Memcached) Get(ctx context.Context, key string, value interface{}) (bool, error)

Implements the backend.Cache interface

func (*Memcached) Incr

func (m *Memcached) Incr(ctx context.Context, key string) (int64, error)

Implements the backend.Cache interface

func (*Memcached) Mget

func (m *Memcached) Mget(ctx context.Context, keys []string, values []interface{}) error

Implements the backend.Cache interface

func (*Memcached) Mset

func (m *Memcached) Mset(ctx context.Context, keys []string, values []interface{}) error

Implements the backend.Cache interface

func (*Memcached) Put

func (m *Memcached) Put(ctx context.Context, key string, value interface{}) error

Implements the backend.Cache interface

Jump to

Keyboard shortcuts

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