Documentation
¶
Index ¶
- func GetDatastore(name string) datastore.Datastore
- func RegistDatastore(name string, ds datastore.Datastore)
- func RegistKeyname(name string, keyname string)
- type DispatchDatastore
- func (this *DispatchDatastore) Batch() (datastore.Batch, error)
- func (this *DispatchDatastore) Close() error
- func (this *DispatchDatastore) Delete(key datastore.Key) (err error)
- func (this *DispatchDatastore) Get(key datastore.Key) (value []byte, err error)
- func (this *DispatchDatastore) GetSize(key datastore.Key) (size int, err error)
- func (this *DispatchDatastore) Has(key datastore.Key) (exists bool, err error)
- func (this *DispatchDatastore) Put(key datastore.Key, value []byte) (err error)
- func (this *DispatchDatastore) Query(q dsq.Query) (dsq.Results, error)
- func (this *DispatchDatastore) Sync(prefix datastore.Key) error
- type DispatchRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatastore ¶
func GetDatastore(name string) datastore.Datastore
func RegistDatastore ¶
func RegistDatastore(name string, ds datastore.Datastore)
func RegistKeyname ¶
Types ¶
type DispatchDatastore ¶
type DispatchDatastore struct { }
DispatchDatastore uses a standard Go map for internal storage.
func NewDispatchDatastore ¶
func NewDispatchDatastore() (this *DispatchDatastore)
func (*DispatchDatastore) Batch ¶
func (this *DispatchDatastore) Batch() (datastore.Batch, error)
func (*DispatchDatastore) Close ¶
func (this *DispatchDatastore) Close() error
func (*DispatchDatastore) Delete ¶
func (this *DispatchDatastore) Delete(key datastore.Key) (err error)
Delete implements Datastore.Delete
func (*DispatchDatastore) Get ¶
func (this *DispatchDatastore) Get(key datastore.Key) (value []byte, err error)
* GetValue其实可以支持返回多条记录和全文检索结果 一般Key的格式是/peerEndpoint/12D3KooWG59NPEuY1dseFzXMSyYbHQb1pfpPiMq5fk7c48exxNJp 如果需要支持条件查询,第二个/后的格式就不是这样的,可以用=表示条件,类似url,甚至类似elastic的查询条件
func (*DispatchDatastore) GetSize ¶
func (this *DispatchDatastore) GetSize(key datastore.Key) (size int, err error)
GetSize implements Datastore.GetSize
func (*DispatchDatastore) Has ¶
func (this *DispatchDatastore) Has(key datastore.Key) (exists bool, err error)
Has implements Datastore.Has
func (*DispatchDatastore) Put ¶
func (this *DispatchDatastore) Put(key datastore.Key, value []byte) (err error)
Put implements Datastore.Put
func (*DispatchDatastore) Sync ¶
func (this *DispatchDatastore) Sync(prefix datastore.Key) error
Sync implements Datastore.Sync
type DispatchRequest ¶
type DispatchRequest struct { Name string Keyname string Datastore datastore.Datastore Service service2.BaseService Keyvalue map[string]string }
func NewKeyRequest ¶
func NewKeyRequest(key datastore.Key) (*DispatchRequest, error)
func NewPrefixRequest ¶
func NewPrefixRequest(prefix string) (*DispatchRequest, error)
Click to show internal directories.
Click to hide internal directories.