store

package
v0.0.0-...-f247dbc Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectNotExist = errors.New("object is not exit")

ErrObjectNotExist object is not exist

Functions

This section is empty.

Types

type KVMap

type KVMap struct {
	DB *gorocksdb.DB
}

KVMap struct

func NewKVMap

func NewKVMap(dir string) (*KVMap, error)

NewKVMap return rocksdb db

func (*KVMap) DeleteObject

func (kvmap *KVMap) DeleteObject(bucket, object string) error

DeleteObject delete object

func (*KVMap) GetObject

func (kvmap *KVMap) GetObject(bucket, object string) (obj *Object, err error)

GetObject get object

func (*KVMap) PutObject

func (kvmap *KVMap) PutObject(bucket, object, meta string) error

PutObject put object

type Object

type Object struct {
	BucketName string
	ObjectKey  string
	Meta       string
}

Object struct

type ObjectMap

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

ObjectMap object op for mysql

func NewObjectMap

func NewObjectMap(addr string, maxConn, maxIdle int) (*ObjectMap, error)

NewObjectMap return object map

func (*ObjectMap) DeleteObject

func (omap *ObjectMap) DeleteObject(bucket, object string) error

DeleteObject delete object

func (*ObjectMap) GetObject

func (omap *ObjectMap) GetObject(bucket, object string) (obj *Object, err error)

GetObject get object

func (*ObjectMap) NewQueryObject

func (omap *ObjectMap) NewQueryObject(rows *sql.Rows) (object *Object, err error)

NewQueryObject new query object

func (*ObjectMap) PutObject

func (omap *ObjectMap) PutObject(bucket, object, meta string) error

PutObject put object

type Store

type Store interface {
	PutObject(bucket, object, meta string) error
	DeleteObject(bucket, object string) error
	GetObject(bucket, object string) (obj *Object, err error)
}

Store interface

Jump to

Keyboard shortcuts

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