store

package
v0.0.0-...-6b52c20 Latest Latest
Warning

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

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

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 {
	Name  string
	Value interface{}
}

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
	Filter *Cond
}

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