pundun

– import “github.com/erdemaksu/pundun”

Usage

const (
	Second      = 0
	Millisecond = 1
	Microsecond = 2
	Nanosecond  = 3
)
const (
	Seconds = 0
	Minutes = 1
	Hours   = 2
)
const (
	Megabytes = 0
	Gigabytes = 1
)
const (
	Result = 0
	Error  = 1
)
const (
	Increment = 0
	Overwrite = 1
)
const (
	Leveldb           = 0
	MemLeveldb        = 1
	LeveldbWrapped    = 2
	MemLeveldbWrapped = 3
	LeveldbTda        = 4
	MemLeveldbTda     = 5
)
const (
	VirtualNodes = 0
	Consistent   = 1
	Uniform      = 2
	Rendezvous   = 3
)
const (
	OK = 0
)

func CloseTable

func CloseTable(s Session, tableName string) (interface{}, error)

func CreateTable

func CreateTable(s Session, tableName string, key []string, options map[string]interface{}) (interface{}, error)

func Delete

func Delete(s Session, tableName string, key map[string]interface{}) (interface{}, error)

func DeleteTable

func DeleteTable(s Session, tableName string) (interface{}, error)

func Disconnect

func Disconnect(s Session)

func First

func First(s Session, tableName string) (interface{}, error)

func GetTid

func GetTid(s Session) int32

func Last

func Last(s Session, tableName string) (interface{}, error)

func Next

func Next(s Session, it []byte) (interface{}, error)

func OpenTable

func OpenTable(s Session, tableName string) (interface{}, error)

func Prev

func Prev(s Session, it []byte) (interface{}, error)

func Read

func Read(s Session, tableName string, key map[string]interface{}) (interface{}, error)

func ReadRange

func ReadRange(s Session, tableName string, skey, ekey map[string]interface{}, limit int) (interface{}, error)

func ReadRangeN

func ReadRangeN(s Session, tableName string, skey map[string]interface{}, n int) (interface{}, error)

func Seek

func Seek(s Session, tableName string, key map[string]interface{}) (interface{}, error)

func SendMsg

func SendMsg(s Session, data []byte) []byte

func TableInfo

func TableInfo(s Session, tableName string, attrs []string) (interface{}, error)

func Update

func Update(s Session, tableName string, key map[string]interface{}, upOps []UpdateOperation) (interface{}, error)

func Write

func Write(s Session, tableName string, key, columns map[string]interface{}) (interface{}, error)

type Client

type Client struct {
}

type Iterator

type Iterator struct {
	Kvp KVP
	It  []byte
}

type KVL

type KVL struct {
	List         []KVP
	Continuation map[string]interface{}
}

type KVP

type KVP struct {
	Key     map[string]interface{}
	Columns map[string]interface{}
}

type Session

type Session struct {
}

func Connect

func Connect(host, user, pass string) (Session, error)

type SizeMargin

type SizeMargin struct {
	Unit  int
	Value int32
}

type Tda

type Tda struct {
	NumOfBuckets int32
	TimeMargin   TimeMargin
	TsField      string
	Precision    int
}

type TimeMargin

type TimeMargin struct {
	Unit  int
	Value int32
}

type UpdateOperation

type UpdateOperation struct {
	Field        string
	Instruction  int
	Value        interface{}
	DefaultValue interface{}
	Treshold     *uint32
	SetValue     *uint32
}

type Wrapper

type Wrapper struct {
	NumOfBuckets int32
	TimeMargin   TimeMargin
	SizeMargin   SizeMargin
}