store

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddValue

func AddValue(bucket string, key []byte, value []byte) error

func AddValueCompress

func AddValueCompress(bucket string, key []byte, value []byte) error

func Count

func Count(o interface{}) (int, error)

func Create

func Create(o interface{}) error

func Delete

func Delete(o interface{}) error

func DeleteBucket

func DeleteBucket(bucket string, key []byte, value []byte) error

func DeleteValue

func DeleteValue(bucket string, key []byte, value []byte) error

func Get

func Get(o interface{}) error

func GetBy

func GetBy(field string, value interface{}, to interface{}) error

func GetCompressedValue

func GetCompressedValue(bucket string, key []byte) []byte

func GetValue

func GetValue(bucket string, key []byte) []byte

func RegisterDBConnection

func RegisterDBConnection(h *gorm.DB)

func RegisterKVStoreHandler

func RegisterKVStoreHandler(h KVStore)

func Save

func Save(o interface{}) error

func Update

func Update(o interface{}) error

Types

type Cond

type Cond struct {
	Field string
	Op    string
	Value interface{}
}

func And

func And(conds ...*Cond) []*Cond

func Eq

func Eq(field string, value interface{}) *Cond

func Ge

func Ge(field string, value interface{}) *Cond

func Gt

func Gt(field string, value interface{}) *Cond

func Le

func Le(field string, value interface{}) *Cond

func Lt

func Lt(field string, value interface{}) *Cond

func NotEq

func NotEq(field string, value interface{}) *Cond

type KVStore

type KVStore interface {
	Open() error

	Close() error

	GetValue(bucket string, key []byte) []byte

	GetCompressedValue(bucket string, key []byte) []byte

	AddValueCompress(bucket string, key []byte, value []byte) error

	AddValue(bucket string, key []byte, value []byte) error

	DeleteValue(bucket string, key []byte, value []byte) error

	DeleteBucket(bucket string, key []byte, value []byte) error
}

type ORM

type ORM interface {
	Save(o interface{}) error

	Update(o interface{}) error

	Delete(o interface{}) error

	Search(o interface{}, q *Query) (error, Result)

	Get(key string, value interface{}, to interface{}) error

	Count(o interface{}) (int, error)
}

type Query

type Query struct {
	Sort     string
	From     int
	Size     int
	Conds    []*Cond
	RawQuery string
}

type Result

type Result struct {
	Total  int
	Result interface{}
}
func Search(o interface{}, q *Query) (error, Result)

Jump to

Keyboard shortcuts

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