cache

package module
v0.0.0-...-b61a0b6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: MIT Imports: 3 Imported by: 0

README

cache

A simple wrapper around memcached in Go

Why?

To provide a developer friendly client library.

Installing

Install the dependency

  • go get github.com/bradfitz/gomemcache/memcache

Then, this package

  • go get github.com/maximelamure/cache

Examples

See cache_test.go

Documentation

See https://godoc.org/github.com/maximelamure/cache

Or run:

godoc github.com/maximelamure/cache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string) error

Delete deletes the item

func Get

func Get(key string, obj interface{}) bool

Get gets the item for the given key. The key must be at most 250 bytes in length.

func Init

func Init(servers ...string)

Init initiates a memcache client using the provided server(s) with equal weight. If a server is listed multiple times, it gets a proportional amount of weight.

func Set

func Set(key string, object interface{}, expiration int32) error

Set writes the given item, unconditionally. expiration is the cache expiration time, in seconds: either a relative time from now (up to 1 month), or an absolute Unix epoch time. Zero means the Item has no expiration time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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