Documentation ¶
Index ¶
- type XormDatastore
- func (this *XormDatastore) Batch() (datastore.Batch, error)
- func (this *XormDatastore) Close() error
- func (this *XormDatastore) Delete(key datastore.Key) (err error)
- func (this *XormDatastore) Get(key datastore.Key) (value []byte, err error)
- func (this *XormDatastore) GetSize(key datastore.Key) (size int, err error)
- func (this *XormDatastore) Has(key datastore.Key) (exists bool, err error)
- func (this *XormDatastore) Put(key datastore.Key, value []byte) (err error)
- func (this *XormDatastore) Query(q dsq.Query) (dsq.Results, error)
- func (this *XormDatastore) Sync(prefix datastore.Key) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XormDatastore ¶
type XormDatastore struct { }
XormDatastore uses a standard Go map for internal storage.
func NewXormDatastore ¶
func NewXormDatastore() (this *XormDatastore)
NewXormDatastore constructs a XormDatastore. It is _not_ thread-safe by default, wrap using sync.MutexWrap if you need thread safety (the answer here is usually yes).
func (*XormDatastore) Batch ¶
func (this *XormDatastore) Batch() (datastore.Batch, error)
func (*XormDatastore) Close ¶
func (this *XormDatastore) Close() error
func (*XormDatastore) Delete ¶
func (this *XormDatastore) Delete(key datastore.Key) (err error)
Delete implements Datastore.Delete
func (*XormDatastore) Get ¶
func (this *XormDatastore) Get(key datastore.Key) (value []byte, err error)
* GetValue其实可以支持返回多条记录和全文检索结果 一般Key的格式是/peerEndpoint/12D3KooWG59NPEuY1dseFzXMSyYbHQb1pfpPiMq5fk7c48exxNJp 如果需要支持条件查询,第二个/后的格式就不是这样的,可以用=表示条件,类似url,甚至类似elastic的查询条件
func (*XormDatastore) GetSize ¶
func (this *XormDatastore) GetSize(key datastore.Key) (size int, err error)
GetSize implements Datastore.GetSize
func (*XormDatastore) Has ¶
func (this *XormDatastore) Has(key datastore.Key) (exists bool, err error)
Has implements Datastore.Has
func (*XormDatastore) Put ¶
func (this *XormDatastore) Put(key datastore.Key, value []byte) (err error)
Put implements Datastore.Put
func (*XormDatastore) Sync ¶
func (this *XormDatastore) Sync(prefix datastore.Key) error
Sync implements Datastore.Sync
Click to show internal directories.
Click to hide internal directories.