– import “github.com/erdemaksu/pundun”
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(s Session, tableName string) (interface{}, error)
func CreateTable(s Session, tableName string, key []string, options map[string]interface{}) (interface{}, error)
func Delete(s Session, tableName string, key map[string]interface{}) (interface{}, error)
func DeleteTable(s Session, tableName string) (interface{}, error)
func Disconnect(s Session)
func First(s Session, tableName string) (interface{}, error)
func GetTid(s Session) int32
func Last(s Session, tableName string) (interface{}, error)
func Next(s Session, it []byte) (interface{}, error)
func OpenTable(s Session, tableName string) (interface{}, error)
func Prev(s Session, it []byte) (interface{}, error)
func Read(s Session, tableName string, key map[string]interface{}) (interface{}, error)
func ReadRange(s Session, tableName string, skey, ekey map[string]interface{}, limit int) (interface{}, error)
func ReadRangeN(s Session, tableName string, skey map[string]interface{}, n int) (interface{}, error)
func Seek(s Session, tableName string, key map[string]interface{}) (interface{}, error)
func SendMsg(s Session, data []byte) []byte
func TableInfo(s Session, tableName string, attrs []string) (interface{}, error)
func Update(s Session, tableName string, key map[string]interface{}, upOps []UpdateOperation) (interface{}, error)
func Write(s Session, tableName string, key, columns map[string]interface{}) (interface{}, error)
type Client struct {
}
type Iterator struct {
Kvp KVP
It []byte
}
type KVL struct {
List []KVP
Continuation map[string]interface{}
}
type KVP struct {
Key map[string]interface{}
Columns map[string]interface{}
}
type Session struct {
}
func Connect(host, user, pass string) (Session, error)
type SizeMargin struct {
Unit int
Value int32
}
type Tda struct {
NumOfBuckets int32
TimeMargin TimeMargin
TsField string
Precision int
}
type TimeMargin struct {
Unit int
Value int32
}
type UpdateOperation struct {
Field string
Instruction int
Value interface{}
DefaultValue interface{}
Treshold *uint32
SetValue *uint32
}
type Wrapper struct {
NumOfBuckets int32
TimeMargin TimeMargin
SizeMargin SizeMargin
}