handler

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: 9 Imported by: 0

Documentation

Index

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

func RegistKeyname(name string, keyname string)

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

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

Query implements Datastore.Query

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)

Jump to

Keyboard shortcuts

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