gos

package module
v0.0.0-...-5a57a2e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2018 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gos

Go Object Store

Documentation

Overview

Package gos provides an object store using ctrie with hash function spooky

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(t *Table)

Delete removes the table if it existed.

Types

type Table

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

func Get

func Get(name string) *Table

Get returns a table with name, creates one if not existed.

func (Table) Copy

func (t Table) Copy() *Table

Copy returns a copy of current table Modification to the copy has no effect on original table

func (Table) Delete

func (t Table) Delete(key []byte) (deleted interface{}, ok bool)

Delete removes a key, returns the removed

func (Table) Get

func (t Table) Get(key []byte) (got interface{}, ok bool)

Get loads the value for the key, returns nil if not existed

func (Table) Put

func (t Table) Put(key []byte, value interface{})

Put stores the value for the key, replacing the old value if the key existed

func (Table) Range

func (t Table) Range(f func(key []byte, value interface{}) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

It is promised that every key/value pair is visited once. Any modification with the table during the range will not visible to f.

func (Table) Size

func (t Table) Size() uint

Size returns the current size of table

Jump to

Keyboard shortcuts

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