kbase

package module
v0.0.0-...-117c8f4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

README

Kbase

a key-value store implemented in go which is

  • embedded
  • distributed
  • in-memory
  • eventual consistent

Architecture

gossip based cluster powered by ringpop

TBD

How to use

TBD

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingKspace = errors.New("ErrMissingKspace")
)

Functions

This section is empty.

Types

type Deserializer

type Deserializer func([]byte) (Value, error)

type Kbase

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

func NewKbase

func NewKbase(hostport string, seednodes []string, spaceDefs ...*KspaceDef) (kbase *Kbase)

func (*Kbase) ClusterSize

func (this *Kbase) ClusterSize() int

func (*Kbase) HandleOffer

func (this *Kbase) HandleOffer(ctx context.Context, offer *rpc.Offer) (response *rpc.KeyResponse, err error)

func (*Kbase) HandlePoll

func (this *Kbase) HandlePoll(ctx context.Context, poll *rpc.Poll) (response *rpc.KeyResponse, err error)

func (*Kbase) HandleRevoke

func (this *Kbase) HandleRevoke(ctx context.Context, revoke *rpc.Revoke) (response *rpc.KeyResponse, err error)

func (*Kbase) SpaceOf

func (this *Kbase) SpaceOf(space string) *Kspace

type Key

type Key string

type Kspace

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

func (*Kspace) GetLocal

func (this *Kspace) GetLocal(key string) (result Value)

func (*Kspace) Offer

func (this *Kspace) Offer(key string, value Value) (err error)

发布key-value

func (*Kspace) Poll

func (this *Kspace) Poll(key string) (results map[string]Value)

查询key

func (*Kspace) Revoke

func (this *Kspace) Revoke(key string)

撤销key

type KspaceDef

type KspaceDef struct {
	Name         string
	Serializer   Serializer
	Deserializer Deserializer
}

type Serializer

type Serializer func(Value) ([]byte, error)

type Value

type Value interface{}

Directories

Path Synopsis
Package rpc is a generated protocol buffer package.
Package rpc is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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