xorm

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

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) Query

func (this *XormDatastore) Query(q dsq.Query) (dsq.Results, error)

Query implements Datastore.Query

func (*XormDatastore) Sync

func (this *XormDatastore) Sync(prefix datastore.Key) error

Sync implements Datastore.Sync

Jump to

Keyboard shortcuts

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