btree

package
v0.0.0-...-2e7882b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer(numShards int) *Container

func (*Container) Del

func (c *Container) Del(key string) error

func (*Container) Exists

func (c *Container) Exists(key string) bool

func (*Container) Get

func (c *Container) Get(key string, dstVal interface{}) (err error)

func (*Container) Set

func (c *Container) Set(key string, val interface{}, exp time.Duration) error

type Tree

type Tree struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Tree is a wrapper for github.com/google/btree which adds expiration times and parallel thread write safetey

func New

func New() *Tree

New returns a newly initialized btree based cache with a default degree of 2

func (*Tree) Del

func (t *Tree) Del(key string) error

Del implements the "cache.Cache".Del interface

func (*Tree) Exists

func (t *Tree) Exists(key string) (exists bool)

Exists implements the "cache.Cache".Exists interface

func (*Tree) Get

func (t *Tree) Get(key string, dstVal interface{}) error

Get implements the "cache.Cache".Get interface

func (*Tree) Set

func (t *Tree) Set(key string, val interface{}, exp time.Duration) error

Set implements the "cache.Cache".Set interface

func (*Tree) Tree

func (t *Tree) Tree() *btree.BTree

Tree returns the underlying btree

Jump to

Keyboard shortcuts

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