collection

package
v0.0.0-...-49ede41 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// It will replaced when value of configuration is not same with this value
	TTL_SCANNER_DELAY_MILLIS = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Timestamp      int64
	DocumentKeySet *treeset.Set
}

func NewBucket

func NewBucket(timestamp int64) *Bucket

func (*Bucket) Add

func (b *Bucket) Add(key string)

func (*Bucket) Clear

func (b *Bucket) Clear()

func (*Bucket) Empty

func (b *Bucket) Empty() bool

func (*Bucket) ForEach

func (b *Bucket) ForEach(fnc func(int, interface{}))

func (*Bucket) Remove

func (b *Bucket) Remove(key string)

func (*Bucket) Values

func (b *Bucket) Values() []interface{}

type Collection

type Collection struct {
	Name      string
	Opened    bool
	ScanTtl   bool
	Documents hashmap.Map
	TtlIndex  btree.Tree
	OpLock    sync.Mutex
	CreatedAt int64
	// contains filtered or unexported fields
}

func New

func New(name string, config *configs.Config) *Collection

func (*Collection) Clear

func (c *Collection) Clear()

func (*Collection) Close

func (c *Collection) Close() *Collection

func (*Collection) ContainsKey

func (c *Collection) ContainsKey(key string) (contains bool)

func (*Collection) Get

func (c *Collection) Get(key string) (interface{}, bool)

func (*Collection) Open

func (c *Collection) Open() *Collection

func (*Collection) Put

func (c *Collection) Put(
	key string,
	value []byte,
	contentType string,
	expAfterSec int) *document.Document

func (*Collection) PutOrUpdate

func (c *Collection) PutOrUpdate(
	key string,
	value []byte,
	contentType string,
	expAfterSec int) *document.Document

func (*Collection) Remove

func (c *Collection) Remove(key string) bool

func (*Collection) Size

func (c *Collection) Size() int

func (*Collection) String

func (c *Collection) String() string

Jump to

Keyboard shortcuts

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